diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/bridge/yongSheng.vue b/src/views/bridge/yongSheng.vue new file mode 100644 index 0000000..c561be5 --- /dev/null +++ b/src/views/bridge/yongSheng.vue @@ -0,0 +1,44 @@ + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/bridge/yongSheng.vue b/src/views/bridge/yongSheng.vue new file mode 100644 index 0000000..c561be5 --- /dev/null +++ b/src/views/bridge/yongSheng.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index c5cc0e7..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/bridge/yongSheng.vue b/src/views/bridge/yongSheng.vue new file mode 100644 index 0000000..c561be5 --- /dev/null +++ b/src/views/bridge/yongSheng.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index c5cc0e7..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue deleted file mode 100644 index 2d54fad..0000000 --- a/src/views/example/tableExample.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/bridge/yongSheng.vue b/src/views/bridge/yongSheng.vue new file mode 100644 index 0000000..c561be5 --- /dev/null +++ b/src/views/bridge/yongSheng.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index c5cc0e7..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue deleted file mode 100644 index 2d54fad..0000000 --- a/src/views/example/tableExample.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/src/views/order/listMaintainRecords.vue b/src/views/order/listMaintainRecords.vue new file mode 100644 index 0000000..cc4f4e0 --- /dev/null +++ b/src/views/order/listMaintainRecords.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/bridge/yongSheng.vue b/src/views/bridge/yongSheng.vue new file mode 100644 index 0000000..c561be5 --- /dev/null +++ b/src/views/bridge/yongSheng.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index c5cc0e7..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue deleted file mode 100644 index 2d54fad..0000000 --- a/src/views/example/tableExample.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/src/views/order/listMaintainRecords.vue b/src/views/order/listMaintainRecords.vue new file mode 100644 index 0000000..cc4f4e0 --- /dev/null +++ b/src/views/order/listMaintainRecords.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/src/views/overview/overview.vue b/src/views/overview/overview.vue new file mode 100644 index 0000000..9ad6a5a --- /dev/null +++ b/src/views/overview/overview.vue @@ -0,0 +1,142 @@ + + + + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/bridge/yongSheng.vue b/src/views/bridge/yongSheng.vue new file mode 100644 index 0000000..c561be5 --- /dev/null +++ b/src/views/bridge/yongSheng.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index c5cc0e7..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue deleted file mode 100644 index 2d54fad..0000000 --- a/src/views/example/tableExample.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/src/views/order/listMaintainRecords.vue b/src/views/order/listMaintainRecords.vue new file mode 100644 index 0000000..cc4f4e0 --- /dev/null +++ b/src/views/order/listMaintainRecords.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/src/views/overview/overview.vue b/src/views/overview/overview.vue new file mode 100644 index 0000000..9ad6a5a --- /dev/null +++ b/src/views/overview/overview.vue @@ -0,0 +1,142 @@ + + + + + + + diff --git a/src/views/statistics/maintainStatistics.vue b/src/views/statistics/maintainStatistics.vue new file mode 100644 index 0000000..3066bb9 --- /dev/null +++ b/src/views/statistics/maintainStatistics.vue @@ -0,0 +1,258 @@ + + + + + diff --git a/config/index.js b/config/index.js index 8abd37a..491c608 100644 --- a/config/index.js +++ b/config/index.js @@ -69,7 +69,7 @@ * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: '/bridge/', /** * Source Maps diff --git a/src/api/common.js b/src/api/common.js index 87c582b..7804714 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -2,10 +2,14 @@ * 常用接口 */ import request from '@/utils/request' +import Vue from 'vue' + // 模板下载 export function downloadTemplate(fileName) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath return request({ - url: 'template/download', + url: lampPath + 'template/download', method: 'get', params: { filename: fileName @@ -19,7 +23,7 @@ const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'fileUpload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..0b5c2be --- /dev/null +++ b/src/api/system/bridge.js @@ -0,0 +1,80 @@ +/** + * 桥梁管理接口 + */ +import request from '@/utils/request' + +// 获取桥梁详情 +export function getDetail(id) { + return request({ + url: 'bridge/bridge/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: 'bridge/bridge/update', + method: 'post', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..d2745ea --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,76 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: 'bridge/maintain/listPage', + method: 'get', + params + }) +} +// 批量导出 +export function exportRecords(params) { + return request({ + url: 'bridge/maintain/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +export function getContentList(params) { + return request({ + url: 'maintain/contentByType', + method: 'get', + params: { + type: params + } + }) +} +export function getPersons() { + return request({ + url: 'maintain/getUsers', + method: 'get' + }) +} +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 编辑 +export function editRecord(params) { + return request({ + url: 'maintain/update', + method: 'post', + params + }) +} +// 新增 +export function addRecord(params) { + return request({ + url: 'maintain/add', + method: 'post', + params + }) +} +// 删除 +export function delRecord(id) { + return request({ + url: 'maintain/delete', + method: 'post', + params: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..1ef2e62 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,24 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 年养护次数统计 +export function countByYear(params) { + return request({ + url: 'bridge/maintain/maintainCount', + method: 'get', + params + }) +} + +// 统计一年每个月每座桥的养护/巡检次数 +export function countByMonth(params) { + return request({ + url: 'bridge/maintain/countByMonth', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/location_green.png b/src/assets/global_images/location_green.png new file mode 100644 index 0000000..aa8be65 --- /dev/null +++ b/src/assets/global_images/location_green.png Binary files differ diff --git a/src/assets/global_images/location_red.png b/src/assets/global_images/location_red.png new file mode 100644 index 0000000..2be8c3d --- /dev/null +++ b/src/assets/global_images/location_red.png Binary files differ diff --git a/src/assets/global_images/location_yellow.png b/src/assets/global_images/location_yellow.png new file mode 100644 index 0000000..5ab6f4d --- /dev/null +++ b/src/assets/global_images/location_yellow.png Binary files differ diff --git a/src/components/DownloadTemplate/index.vue b/src/components/DownloadTemplate/index.vue index 8ded2cd..7807cac 100644 --- a/src/components/DownloadTemplate/index.vue +++ b/src/components/DownloadTemplate/index.vue @@ -47,8 +47,8 @@ diff --git a/src/icons/svg/bridge.svg b/src/icons/svg/bridge.svg new file mode 100644 index 0000000..1a0336f --- /dev/null +++ b/src/icons/svg/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon-map.svg b/src/icons/svg/icon-map.svg new file mode 100644 index 0000000..f9ad1a5 --- /dev/null +++ b/src/icons/svg/icon-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index f2d105d..c400ef4 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ // echart // import echarts from 'echarts' // Vue.prototype.$echarts = echarts +// 引入v-charts +import VCharts from 'v-charts' +Vue.use(VCharts) // 将自动注册所有组件为全局组件 // import dataV from '@jiaminghi/data-view' diff --git a/src/router/index.js b/src/router/index.js index 44cba3b..0a5a234 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,9 @@ /* Layout */ import Layout from '@/layout/Layout' -import { systemRouters } from './modules/system' -import { exampleRouters } from './modules/example' +import { orderRouters } from './modules/order' +import { bridgeRouters } from './modules/bridge' +import { statisticsRouters } from './modules/statistics' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -55,8 +56,8 @@ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } + component: () => import('@/views/overview/overview.vue'), + meta: { title: '桥梁分布', icon: 'icon-map', noCache: true, affix: true } }] } ] @@ -70,7 +71,8 @@ // 异步挂载路由 // 动态需要根据权限加载的路由表 export const asyncRouterMap = [ - ...exampleRouters, - ...systemRouters, + ...orderRouters, + ...bridgeRouters, + ...statisticsRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/bridge.js b/src/router/modules/bridge.js new file mode 100644 index 0000000..53f2a39 --- /dev/null +++ b/src/router/modules/bridge.js @@ -0,0 +1,42 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const bridgeRouters = [ + { + path: 'bridge', + component: Layout, + redirect: '/yongSheng', + name: 'Bridge', + meta: { + title: '桥梁管理', + icon: 'icon-config', // 图标 + permission: ['/bridgeManage']// 权限名称 + }, + children: [ + { + path: '/huangZhou', + name: 'HuangZhou', + component: () => import('@/views/bridge/huangZhou'), + meta: { title: '黄洲桥', icon: 'function', permission: ['/huangZhou'] } + }, + { + path: '/chongRen', + name: 'ChongRen', + component: () => import('@/views/bridge/chongRen'), + meta: { title: '崇仁大桥', icon: 'function', permission: ['/chongRen'] } + }, + { + path: '/yongSheng', + name: 'YongSheng', + component: () => import('@/views/bridge/yongSheng'), + meta: { title: '永胜桥', icon: 'function', permission: ['/yongSheng'] } + }, + { + path: '/guangMing', + name: 'GuangMing', + component: () => import('@/views/bridge/guangMing'), + meta: { title: '光明桥', icon: 'function', permission: ['/guangMing'] } + } + ] + } +] diff --git a/src/router/modules/example.js b/src/router/modules/example.js deleted file mode 100644 index 9076d50..0000000 --- a/src/router/modules/example.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Layout */ -import Layout from '@/layout/Layout' -export const exampleRouters = [{ - path: 'example', - component: Layout, - redirect: '/exampleTable', - name: 'Example', - alwaysShow: true, - meta: { - title: '示例', - icon: 'icon-config' // 图标 - }, - children: [ - { - path: '/exampleTable', - name: 'ExampleTable', - component: () => import('@/views/example/tableExample'), - meta: { title: '表格示例', icon: '' } - } - ] -}] diff --git a/src/router/modules/order.js b/src/router/modules/order.js new file mode 100644 index 0000000..fdb43c5 --- /dev/null +++ b/src/router/modules/order.js @@ -0,0 +1,23 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const orderRouters = [ + { + path: 'order', + component: Layout, + redirect: '/rule', + name: 'Order', + meta: { + title: '工单管理', + icon: 'icon-config', // 图标 + permission: ['/order']// 权限名称 + }, + children: [ + { + path: '/order', + name: 'Order', + component: () => import('@/views/order/listMaintainRecords'), + meta: { title: '养护记录', icon: 'dashboard', permission: ['/order'] } + } + ] + }] diff --git a/src/router/modules/overview.js b/src/router/modules/overview.js new file mode 100644 index 0000000..554d058 --- /dev/null +++ b/src/router/modules/overview.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const overviewRouters = [ + { + path: 'overviewBridge', + component: Layout, + redirect: '/overviewBridge', + name: 'OverviewBridge', + meta: { + title: '桥梁总览', + icon: 'icon-overview', // 图标 + permission: ['/overviewBridge']// 权限名称 + }, + children: [ + { + path: '/overviewBridge', + name: 'OverviewBridge', + component: () => import('@/views/overview/overview.vue'), + meta: { title: '运行总览', icon: 'function', permission: ['/overviewBridge'] } + } + ] + } +] diff --git a/src/router/modules/statistics.js b/src/router/modules/statistics.js new file mode 100644 index 0000000..c87490d --- /dev/null +++ b/src/router/modules/statistics.js @@ -0,0 +1,24 @@ +/* Layout */ +import Layout from '@/layout/Layout' + +export const statisticsRouters = [ + { + path: 'statisticsBridge', + component: Layout, + redirect: 'bridge/statisticsBridge', + name: 'StatisticsBridge', + meta: { + title: '养护统计', + icon: 'icon-config', // 图标 + permission: ['/statisticsBridge']// 权限名称 + }, + children: [ + { + path: '/statisticsBridge', + name: 'StatisticsBridge', + component: () => import('@/views/statistics/maintainStatistics'), + meta: { title: '养护统计', icon: 'function', permission: ['/statisticsBridge'] } + } + ] + } +] diff --git a/src/settings.js b/src/settings.js index b568ce0..b8159bf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,7 +3,7 @@ * @type {boolean} true | false * @description 是否显示设置按钮 */ - showSettings: true, + showSettings: false, /** * @type {boolean} true | false diff --git a/src/utils/baseConfig.js b/src/utils/baseConfig.js index 1f4fa38..999593e 100644 --- a/src/utils/baseConfig.js +++ b/src/utils/baseConfig.js @@ -1,5 +1,5 @@ const project = { - title: '后台管理系统前端基础框架' + title: '路桥养护子系统' } export function getProject() { return project diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js new file mode 100644 index 0000000..b12678f --- /dev/null +++ b/src/utils/downloadUtils.js @@ -0,0 +1,21 @@ +// 下载文件的公共方法 +export function downloadFile(file, fileName) { + const blob = new Blob([file]) + // IE及IE内核浏览器,ie10+ + if (window.navigator.msSaveBlob) { + try { + window.navigator.msSaveBlob(blob, fileName + '.xlsx') + } catch (e) { + console.log(e) + } + } else { // 其他浏览器 + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) // 创建下载的链接 + downloadElement.href = href + downloadElement.download = fileName + '.xlsx' // 下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() // 点击下载 + document.body.removeChild(downloadElement) // 下载完成移除元素 + window.URL.revokeObjectURL(href) // 释放blob对象 + } +} diff --git a/src/utils/request.js b/src/utils/request.js index c88ea76..dc56e26 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -17,6 +17,13 @@ config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 console.log(config.headers['token']) } + // 在接口增加时间戳 + // if (config.method === 'get') { + config.params = { + _t: Date.parse(new Date()) / 1000, + ...config.params + } + // } return config }, error => { diff --git a/src/views/bridge/chongRen.vue b/src/views/bridge/chongRen.vue new file mode 100644 index 0000000..f2e1ede --- /dev/null +++ b/src/views/bridge/chongRen.vue @@ -0,0 +1,45 @@ + + + + diff --git a/src/views/bridge/components/detail.vue b/src/views/bridge/components/detail.vue new file mode 100644 index 0000000..bde8c5e --- /dev/null +++ b/src/views/bridge/components/detail.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/bridge/components/editBridge.vue b/src/views/bridge/components/editBridge.vue new file mode 100644 index 0000000..ac5a1e4 --- /dev/null +++ b/src/views/bridge/components/editBridge.vue @@ -0,0 +1,290 @@ + + + + diff --git a/src/views/bridge/guangMing.vue b/src/views/bridge/guangMing.vue new file mode 100644 index 0000000..88ebd44 --- /dev/null +++ b/src/views/bridge/guangMing.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/bridge/huangzhou.vue b/src/views/bridge/huangzhou.vue new file mode 100644 index 0000000..7700fa4 --- /dev/null +++ b/src/views/bridge/huangzhou.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/bridge/yongSheng.vue b/src/views/bridge/yongSheng.vue new file mode 100644 index 0000000..c561be5 --- /dev/null +++ b/src/views/bridge/yongSheng.vue @@ -0,0 +1,44 @@ + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index c5cc0e7..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue deleted file mode 100644 index 2d54fad..0000000 --- a/src/views/example/tableExample.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/src/views/order/listMaintainRecords.vue b/src/views/order/listMaintainRecords.vue new file mode 100644 index 0000000..cc4f4e0 --- /dev/null +++ b/src/views/order/listMaintainRecords.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/src/views/overview/overview.vue b/src/views/overview/overview.vue new file mode 100644 index 0000000..9ad6a5a --- /dev/null +++ b/src/views/overview/overview.vue @@ -0,0 +1,142 @@ + + + + + + + diff --git a/src/views/statistics/maintainStatistics.vue b/src/views/statistics/maintainStatistics.vue new file mode 100644 index 0000000..3066bb9 --- /dev/null +++ b/src/views/statistics/maintainStatistics.vue @@ -0,0 +1,258 @@ + + + + + diff --git a/static/project.config.json b/static/project.config.json index cb1eb78..daffcd7 100644 --- a/static/project.config.json +++ b/static/project.config.json @@ -1,11 +1,17 @@ { - "title": "基础资源系统", + "title": "路桥养护子系统", "baseUrl": "http://111.198.10.15:11409/", "mainPage": "http://111.198.10.15:11404/dcms/", "singleSys": true, "city":"崇仁县", "mapUrl":"https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", "labelUrl":"https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", - "center":[27.75962, 116.06021], - "zoom":13 + "center":[27.766585, 116.059015], + "zoom":16, + "bridges": [ + { "id": 1, "name": "永胜桥", "lat": 27.763163, "lng": 116.043554 }, + { "id": 2, "name": "黄洲桥", "lat": 27.759709, "lng": 116.053613 }, + { "id": 3, "name": "光明桥", "lat": 27.773253, "lng": 116.075047 }, + { "id": 4, "name": "崇仁大桥", "lat": 27.766585, "lng": 116.059015 } + ] }