diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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/assets/global_images/toilet-position.png b/src/assets/global_images/toilet-position.png new file mode 100644 index 0000000..7db6d9a --- /dev/null +++ b/src/assets/global_images/toilet-position.png Binary files differ diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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/assets/global_images/toilet-position.png b/src/assets/global_images/toilet-position.png new file mode 100644 index 0000000..7db6d9a --- /dev/null +++ b/src/assets/global_images/toilet-position.png Binary files differ diff --git a/src/assets/global_images/toilet.png b/src/assets/global_images/toilet.png new file mode 100644 index 0000000..6d9fc05 --- /dev/null +++ b/src/assets/global_images/toilet.png Binary files differ diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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/assets/global_images/toilet-position.png b/src/assets/global_images/toilet-position.png new file mode 100644 index 0000000..7db6d9a --- /dev/null +++ b/src/assets/global_images/toilet-position.png Binary files differ diff --git a/src/assets/global_images/toilet.png b/src/assets/global_images/toilet.png new file mode 100644 index 0000000..6d9fc05 --- /dev/null +++ b/src/assets/global_images/toilet.png Binary files differ diff --git a/src/assets/global_images/toiletPhoto.png b/src/assets/global_images/toiletPhoto.png new file mode 100644 index 0000000..15d08e2 --- /dev/null +++ b/src/assets/global_images/toiletPhoto.png Binary files differ diff --git a/config/index.js b/config/index.js index 8abd37a..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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/assets/global_images/toilet-position.png b/src/assets/global_images/toilet-position.png new file mode 100644 index 0000000..7db6d9a --- /dev/null +++ b/src/assets/global_images/toilet-position.png Binary files differ diff --git a/src/assets/global_images/toilet.png b/src/assets/global_images/toilet.png new file mode 100644 index 0000000..6d9fc05 --- /dev/null +++ b/src/assets/global_images/toilet.png Binary files differ diff --git a/src/assets/global_images/toiletPhoto.png b/src/assets/global_images/toiletPhoto.png new file mode 100644 index 0000000..15d08e2 --- /dev/null +++ b/src/assets/global_images/toiletPhoto.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..19b33b1 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: '/toilet/', /** * Source Maps diff --git a/package.json b/package.json index 45f055f..9f3a3eb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "echarts": "^4.2.1", "element-ui": "2.13.0", "event-source-polyfill": "^1.0.5", + "file-saver": "^2.0.5", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.7.1", @@ -33,7 +34,9 @@ "vue-amap": "^0.5.9", "vue-baidu-map": "^0.21.22", "vue-router": "3.0.1", - "vuex": "3.0.1" + "vue2-leaflet": "^2.7.0", + "vuex": "3.0.1", + "xlsx": "^0.17.0" }, "devDependencies": { "autoprefixer": "8.5.0", 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/sanitation/statistics.js b/src/api/sanitation/statistics.js new file mode 100644 index 0000000..ffeac18 --- /dev/null +++ b/src/api/sanitation/statistics.js @@ -0,0 +1,22 @@ + +/** + * 考核统计接口 + */ +import request from '@/utils/request' +// 公厕保洁次数统计 +export function getToiletJobCount(params) { + return request({ + url: '/sanitation/statistic/toilet/jobCount', + method: 'get', + params + }) +} + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/toilet.js b/src/api/sanitation/toilet.js new file mode 100644 index 0000000..11affd4 --- /dev/null +++ b/src/api/sanitation/toilet.js @@ -0,0 +1,133 @@ +/** + * 公厕管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' +// 公厕查询 +export function getToiletListPage(params) { + return request({ + url: '/sanitation/toilet/listPage', + method: 'get', + params + }) +} +// 公厕查询 +export function getToiletList(pid) { + return request({ + url: '/sanitation/toilet/list', + method: 'get', + params: { + pid: pid + } + }) +} + +// 添加公厕 +export function addToilet(params) { + return request({ + url: '/sanitation/toilet/add', + method: 'post', + params + }) +} +// 修改公厕机构 +export function updateToilet(params) { + return request({ + url: '/sanitation/toilet/update', + method: 'post', + params + }) +} +// 删除公厕机构 +export function delToilet(ids) { + return request({ + url: '/sanitation/toilet/delete', + method: 'post', + params: { + ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +// 公厕基本信息详情 +export function getToiletInfoDetail(id) { + return request({ + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' + }) +} + +// 某公厕保洁记录 +export function getRecordsByToilet(params) { + return request({ + url: '/sanitation/toilet/jobRecord/detail', + method: 'get', + params + }) +} + +// 某公厕平均评分 +export function getScoreByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/detailScore', + method: 'get', + params + }) +} + +// 某公厕评分列表 +export function getScoreListByToilet(params) { + return request({ + url: '/sanitation/toiletEvaluation/list', + method: 'get', + params + }) +} + + +// 批量导入 +export function batchImportToilet(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: '/sanitation/toilet/import', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} +// 批量导出 +export function batchExportToilet(params, config) { + return request({ + url: '/sanitation/toilet/export', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 公厕保洁记录查询 +export function getToiletJobRecords(params) { + return request({ + url: '/sanitation/toilet/jobRecord', + method: 'get', + params + }) +} + +// 批量导出 +export function batchExportToiletJobRecords(params, config) { + return request({ + url: '/sanitation/toilet/exportJobRecord', + method: 'get', + timeout: 120000, + params, + ...config, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} diff --git a/src/api/system/alarm.js b/src/api/system/alarm.js new file mode 100644 index 0000000..1c3a7ab --- /dev/null +++ b/src/api/system/alarm.js @@ -0,0 +1,62 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getAlarmNowList(params) { + return request({ + url: '/alarm/listNowPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getAlarmHistoryList(params) { + return request({ + url: '/alarm/listHisPage', + method: 'get', + params + }) +} + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/bridge.js b/src/api/system/bridge.js new file mode 100644 index 0000000..e8a4108 --- /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/detail', + method: 'get', + params: { + id: id + } + }) +} + +export function updateBridge(params) { + return request({ + url: '/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/data.js b/src/api/system/data.js new file mode 100644 index 0000000..4c95db5 --- /dev/null +++ b/src/api/system/data.js @@ -0,0 +1,63 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 获取当前报警列表 +export function getHistoryList(params) { + return request({ + url: '/data/hisListPage', + method: 'get', + params + }) +} + +// 获取当前报警列表 +export function getHistory(params) { + return request({ + url: '/data/hisList', + method: 'get', + params + }) +} + + + +// 批量消警 +export function clearAll(params) { + return request({ + url: '/alarm/allClear', + method: 'get', + params + }) +} + +// 消警 +export function clearAlarm(params) { + return request({ + url: '/alarm/cancel', + method: 'get', + params + }) +} + +// 批量导出报警 +export function batchExportAlarm(params) { + return request({ + url: 'person/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} + +// 设置报警阈值 +export function setThresh(params) { + return request({ + url: '/alarm/resetAlarmRule', + method: 'post', + params + }) +} diff --git a/src/api/system/order.js b/src/api/system/order.js new file mode 100644 index 0000000..7007c50 --- /dev/null +++ b/src/api/system/order.js @@ -0,0 +1,71 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRecordList(params) { + return request({ + url: '/maintain/listPage', + method: 'get', + 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: { + bridgeMaintenanceId: id + } + }) +} diff --git a/src/api/system/overview.js b/src/api/system/overview.js new file mode 100644 index 0000000..bca50cc --- /dev/null +++ b/src/api/system/overview.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import qs from "qs" +import Vue from 'vue' + +// 路灯状态统计 +export function getLampStatus() { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampStatus', + method: 'get' + }) +} + +// 路灯总览列表 +export function getLampList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampList', + method: 'get', + params + }) +} + +// 路灯详情 +export function getlampDetail(lampId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampDetail', + method: 'get', + params: { + lampId: lampId + } + }) +} + +// 回路列表 +export function getCircuitList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/circuitList', + method: 'get', + params + }) +} + +// 灯箱列表 +export function getLampBoxList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxList', + method: 'get', + params + }) +} +// 灯箱详情 +export function getLampBoxDetail(lampBoxId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampBoxDetail', + method: 'get', + params: { + lampBoxId: lampBoxId + } + }) +} + +// 报警总览列表 +export function getAlarmList(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmList', + method: 'get', + params + }) +} + +// 报警详情 +export function getAlarmDetail(alarmId) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/alarmDetail', + method: 'get', + params: { + alarmId: alarmId + } + }) +} + +// 路灯控制 +export function lampControl(params) { + const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值 + const lampPath = basetConfig.lampBasePath + return request({ + url: lampPath + 'overview/lampControl', + method: 'post', + params, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/system/rule.js b/src/api/system/rule.js new file mode 100644 index 0000000..76c6b2d --- /dev/null +++ b/src/api/system/rule.js @@ -0,0 +1,59 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// 获取当前报警列表 +export function getRuleList() { + return request({ + url: 'rule/listPage', + method: 'get' + }) +} +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/statistics.js b/src/api/system/statistics.js new file mode 100644 index 0000000..b25efe9 --- /dev/null +++ b/src/api/system/statistics.js @@ -0,0 +1,23 @@ +/** + * 人员管理接口 + */ +import request from '@/utils/request' +// import qs from 'qs' + +// +export function countByToilet(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByToilet', + method: 'get', + params + }) +} + +export function countByDay(params) { + return request({ + url: '/sanitation/toiletStatistic/jobStaticByDate', + method: 'get', + params + }) +} + diff --git a/src/assets/global_images/icon-position.png b/src/assets/global_images/icon-position.png new file mode 100644 index 0000000..7444038 --- /dev/null +++ b/src/assets/global_images/icon-position.png Binary files differ 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/assets/global_images/toilet-position.png b/src/assets/global_images/toilet-position.png new file mode 100644 index 0000000..7db6d9a --- /dev/null +++ b/src/assets/global_images/toilet-position.png Binary files differ diff --git a/src/assets/global_images/toilet.png b/src/assets/global_images/toilet.png new file mode 100644 index 0000000..6d9fc05 --- /dev/null +++ b/src/assets/global_images/toilet.png Binary files differ diff --git a/src/assets/global_images/toiletPhoto.png b/src/assets/global_images/toiletPhoto.png new file mode 100644 index 0000000..15d08e2 --- /dev/null +++ b/src/assets/global_images/toiletPhoto.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/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 5077bef..04d322d 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -79,7 +79,7 @@ -