diff --git a/src/api/sanitation/statistics.js b/src/api/sanitation/statistics.js index 2ca7549..ffeac18 100644 --- a/src/api/sanitation/statistics.js +++ b/src/api/sanitation/statistics.js @@ -11,3 +11,12 @@ params }) } + +// 公厕评分统计 +export function getToiletEvaluation(params) { + return request({ + url: '/sanitation/toiletEvaluation/statistics', + method: 'get', + params + }) +} diff --git a/src/api/sanitation/statistics.js b/src/api/sanitation/statistics.js index 2ca7549..ffeac18 100644 --- a/src/api/sanitation/statistics.js +++ b/src/api/sanitation/statistics.js @@ -11,3 +11,12 @@ 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 index 74181bc..11affd4 100644 --- a/src/api/sanitation/toilet.js +++ b/src/api/sanitation/toilet.js @@ -53,18 +53,17 @@ } // 公厕基本信息详情 -export function getToiletInfoDetail(params) { +export function getToiletInfoDetail(id) { return request({ - url: '/sanitation/toilet/listPage', - method: 'get', - params + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' }) } // 某公厕保洁记录 export function getRecordsByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + url: '/sanitation/toilet/jobRecord/detail', method: 'get', params }) @@ -73,12 +72,22 @@ // 某公厕平均评分 export function getScoreByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + 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() diff --git a/src/api/sanitation/statistics.js b/src/api/sanitation/statistics.js index 2ca7549..ffeac18 100644 --- a/src/api/sanitation/statistics.js +++ b/src/api/sanitation/statistics.js @@ -11,3 +11,12 @@ 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 index 74181bc..11affd4 100644 --- a/src/api/sanitation/toilet.js +++ b/src/api/sanitation/toilet.js @@ -53,18 +53,17 @@ } // 公厕基本信息详情 -export function getToiletInfoDetail(params) { +export function getToiletInfoDetail(id) { return request({ - url: '/sanitation/toilet/listPage', - method: 'get', - params + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' }) } // 某公厕保洁记录 export function getRecordsByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + url: '/sanitation/toilet/jobRecord/detail', method: 'get', params }) @@ -73,12 +72,22 @@ // 某公厕平均评分 export function getScoreByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + 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() diff --git a/src/components/mapWindow/leafletMap.vue b/src/components/mapWindow/leafletMap.vue index 931a5e9..b753cc0 100644 --- a/src/components/mapWindow/leafletMap.vue +++ b/src/components/mapWindow/leafletMap.vue @@ -11,6 +11,16 @@ export default { name: 'LeafletMap', + props: { + minZoom: { + type: Number, + default: 14 + }, + maxZoom: { + type: Number, + default: 18 + } + }, data() { return { map: null, @@ -53,9 +63,10 @@ }, methods: { initMap() { + const { minZoom, maxZoom } = this const map = L.map(this.$refs.mapDiv, { - minZoom: 14, - maxZoom: 25, + minZoom: minZoom, + maxZoom: maxZoom, center: this.baseConfig.center, zoom: this.baseConfig.zoom, zoomControl: false, diff --git a/src/api/sanitation/statistics.js b/src/api/sanitation/statistics.js index 2ca7549..ffeac18 100644 --- a/src/api/sanitation/statistics.js +++ b/src/api/sanitation/statistics.js @@ -11,3 +11,12 @@ 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 index 74181bc..11affd4 100644 --- a/src/api/sanitation/toilet.js +++ b/src/api/sanitation/toilet.js @@ -53,18 +53,17 @@ } // 公厕基本信息详情 -export function getToiletInfoDetail(params) { +export function getToiletInfoDetail(id) { return request({ - url: '/sanitation/toilet/listPage', - method: 'get', - params + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' }) } // 某公厕保洁记录 export function getRecordsByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + url: '/sanitation/toilet/jobRecord/detail', method: 'get', params }) @@ -73,12 +72,22 @@ // 某公厕平均评分 export function getScoreByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + 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() diff --git a/src/components/mapWindow/leafletMap.vue b/src/components/mapWindow/leafletMap.vue index 931a5e9..b753cc0 100644 --- a/src/components/mapWindow/leafletMap.vue +++ b/src/components/mapWindow/leafletMap.vue @@ -11,6 +11,16 @@ export default { name: 'LeafletMap', + props: { + minZoom: { + type: Number, + default: 14 + }, + maxZoom: { + type: Number, + default: 18 + } + }, data() { return { map: null, @@ -53,9 +63,10 @@ }, methods: { initMap() { + const { minZoom, maxZoom } = this const map = L.map(this.$refs.mapDiv, { - minZoom: 14, - maxZoom: 25, + minZoom: minZoom, + maxZoom: maxZoom, center: this.baseConfig.center, zoom: this.baseConfig.zoom, zoomControl: false, diff --git a/src/views/overview/toiletDetailDialog.vue b/src/views/overview/toiletDetailDialog.vue index 167d65e..def17bb 100644 --- a/src/views/overview/toiletDetailDialog.vue +++ b/src/views/overview/toiletDetailDialog.vue @@ -114,8 +114,8 @@ dialogFormVisible: false, listQuery: { toiletId: '', - beginDate: '', // 开始时间 - endDate: '', // 结束时间 + startTime: '', // 开始时间 + endTime: '', // 结束时间 offset: 1, limit: 5 }, // 筛选条件 @@ -168,8 +168,8 @@ this.title = item.name + '详情' this.listQuery = { toiletId: item.id, - beginDate: getLastMonth('yyyy-MM-dd'), - endDate: getToday('yyyy-MM-dd'), + startTime: getLastMonth('yyyy-MM-dd') + ' 00:00:00', + endTime: getToday('yyyy-MM-dd') + ' 23:59:59', offset: 1, limit: 5 } @@ -187,15 +187,17 @@ }, // 保洁记录 fetchCleanRecords() { + this.listLoading = true getRecordsByToilet(this.listQuery).then((res) => { - this.listLoading = true - this.list = [ - { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } - ] - this.total = 4 + this.list = res.data.rows + this.total = res.data.total + // this.list = [ + // { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } + // ] + // this.total = 4 this.listLoading = false }) }, @@ -203,8 +205,7 @@ fetchScoreData() { getScoreByToilet({ toiletId: this.listQuery.toiletId }).then(res => { if (res.code === 200) { - // this.score = res.data - this.score = 4.5 + this.score = res.data } }) }, diff --git a/src/api/sanitation/statistics.js b/src/api/sanitation/statistics.js index 2ca7549..ffeac18 100644 --- a/src/api/sanitation/statistics.js +++ b/src/api/sanitation/statistics.js @@ -11,3 +11,12 @@ 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 index 74181bc..11affd4 100644 --- a/src/api/sanitation/toilet.js +++ b/src/api/sanitation/toilet.js @@ -53,18 +53,17 @@ } // 公厕基本信息详情 -export function getToiletInfoDetail(params) { +export function getToiletInfoDetail(id) { return request({ - url: '/sanitation/toilet/listPage', - method: 'get', - params + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' }) } // 某公厕保洁记录 export function getRecordsByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + url: '/sanitation/toilet/jobRecord/detail', method: 'get', params }) @@ -73,12 +72,22 @@ // 某公厕平均评分 export function getScoreByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + 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() diff --git a/src/components/mapWindow/leafletMap.vue b/src/components/mapWindow/leafletMap.vue index 931a5e9..b753cc0 100644 --- a/src/components/mapWindow/leafletMap.vue +++ b/src/components/mapWindow/leafletMap.vue @@ -11,6 +11,16 @@ export default { name: 'LeafletMap', + props: { + minZoom: { + type: Number, + default: 14 + }, + maxZoom: { + type: Number, + default: 18 + } + }, data() { return { map: null, @@ -53,9 +63,10 @@ }, methods: { initMap() { + const { minZoom, maxZoom } = this const map = L.map(this.$refs.mapDiv, { - minZoom: 14, - maxZoom: 25, + minZoom: minZoom, + maxZoom: maxZoom, center: this.baseConfig.center, zoom: this.baseConfig.zoom, zoomControl: false, diff --git a/src/views/overview/toiletDetailDialog.vue b/src/views/overview/toiletDetailDialog.vue index 167d65e..def17bb 100644 --- a/src/views/overview/toiletDetailDialog.vue +++ b/src/views/overview/toiletDetailDialog.vue @@ -114,8 +114,8 @@ dialogFormVisible: false, listQuery: { toiletId: '', - beginDate: '', // 开始时间 - endDate: '', // 结束时间 + startTime: '', // 开始时间 + endTime: '', // 结束时间 offset: 1, limit: 5 }, // 筛选条件 @@ -168,8 +168,8 @@ this.title = item.name + '详情' this.listQuery = { toiletId: item.id, - beginDate: getLastMonth('yyyy-MM-dd'), - endDate: getToday('yyyy-MM-dd'), + startTime: getLastMonth('yyyy-MM-dd') + ' 00:00:00', + endTime: getToday('yyyy-MM-dd') + ' 23:59:59', offset: 1, limit: 5 } @@ -187,15 +187,17 @@ }, // 保洁记录 fetchCleanRecords() { + this.listLoading = true getRecordsByToilet(this.listQuery).then((res) => { - this.listLoading = true - this.list = [ - { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } - ] - this.total = 4 + this.list = res.data.rows + this.total = res.data.total + // this.list = [ + // { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } + // ] + // this.total = 4 this.listLoading = false }) }, @@ -203,8 +205,7 @@ fetchScoreData() { getScoreByToilet({ toiletId: this.listQuery.toiletId }).then(res => { if (res.code === 200) { - // this.score = res.data - this.score = 4.5 + this.score = res.data } }) }, diff --git a/src/views/overview/toiletLayer.vue b/src/views/overview/toiletLayer.vue index d5b4191..bb4cbda 100644 --- a/src/views/overview/toiletLayer.vue +++ b/src/views/overview/toiletLayer.vue @@ -102,8 +102,8 @@ }) }, // 将点加到地图上 - addPointOnMap: function(itemList, staffLayer, iconType) { - const { iconSize, iconAnchor, popupAnchor } = this + addPointOnMap: function(itemList, layer, iconType) { + const { map, iconSize, iconAnchor, popupAnchor } = this // 图标 const icon = Leaflet.icon({ iconUrl: iconType, @@ -121,15 +121,18 @@ '' + '' + '' + - '' + + '' + '' const popup = Leaflet.popup().setContent(popupStr) if (item.lng > 0 && item.lat > 0) { // 添加marker - const marker = Leaflet.marker([item.lat, item.lng], { icon: icon , item: item}).addTo(staffLayer).bindPopup(popup) + const marker = Leaflet.marker([item.lat, item.lng], { icon: icon, item: item }).addTo(layer).bindPopup(popup) marker.on('click', (e) => { - document.getElementById('detail').onclick = () => { + console.log('marker on click' + item.code) + const btn = document.getElementById('detail' + item.code) + console.log(btn) + btn.onclick = () => { console.log('click detail') this.detail(e.sourceTarget.options.item) } diff --git a/src/api/sanitation/statistics.js b/src/api/sanitation/statistics.js index 2ca7549..ffeac18 100644 --- a/src/api/sanitation/statistics.js +++ b/src/api/sanitation/statistics.js @@ -11,3 +11,12 @@ 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 index 74181bc..11affd4 100644 --- a/src/api/sanitation/toilet.js +++ b/src/api/sanitation/toilet.js @@ -53,18 +53,17 @@ } // 公厕基本信息详情 -export function getToiletInfoDetail(params) { +export function getToiletInfoDetail(id) { return request({ - url: '/sanitation/toilet/listPage', - method: 'get', - params + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' }) } // 某公厕保洁记录 export function getRecordsByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + url: '/sanitation/toilet/jobRecord/detail', method: 'get', params }) @@ -73,12 +72,22 @@ // 某公厕平均评分 export function getScoreByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + 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() diff --git a/src/components/mapWindow/leafletMap.vue b/src/components/mapWindow/leafletMap.vue index 931a5e9..b753cc0 100644 --- a/src/components/mapWindow/leafletMap.vue +++ b/src/components/mapWindow/leafletMap.vue @@ -11,6 +11,16 @@ export default { name: 'LeafletMap', + props: { + minZoom: { + type: Number, + default: 14 + }, + maxZoom: { + type: Number, + default: 18 + } + }, data() { return { map: null, @@ -53,9 +63,10 @@ }, methods: { initMap() { + const { minZoom, maxZoom } = this const map = L.map(this.$refs.mapDiv, { - minZoom: 14, - maxZoom: 25, + minZoom: minZoom, + maxZoom: maxZoom, center: this.baseConfig.center, zoom: this.baseConfig.zoom, zoomControl: false, diff --git a/src/views/overview/toiletDetailDialog.vue b/src/views/overview/toiletDetailDialog.vue index 167d65e..def17bb 100644 --- a/src/views/overview/toiletDetailDialog.vue +++ b/src/views/overview/toiletDetailDialog.vue @@ -114,8 +114,8 @@ dialogFormVisible: false, listQuery: { toiletId: '', - beginDate: '', // 开始时间 - endDate: '', // 结束时间 + startTime: '', // 开始时间 + endTime: '', // 结束时间 offset: 1, limit: 5 }, // 筛选条件 @@ -168,8 +168,8 @@ this.title = item.name + '详情' this.listQuery = { toiletId: item.id, - beginDate: getLastMonth('yyyy-MM-dd'), - endDate: getToday('yyyy-MM-dd'), + startTime: getLastMonth('yyyy-MM-dd') + ' 00:00:00', + endTime: getToday('yyyy-MM-dd') + ' 23:59:59', offset: 1, limit: 5 } @@ -187,15 +187,17 @@ }, // 保洁记录 fetchCleanRecords() { + this.listLoading = true getRecordsByToilet(this.listQuery).then((res) => { - this.listLoading = true - this.list = [ - { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } - ] - this.total = 4 + this.list = res.data.rows + this.total = res.data.total + // this.list = [ + // { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } + // ] + // this.total = 4 this.listLoading = false }) }, @@ -203,8 +205,7 @@ fetchScoreData() { getScoreByToilet({ toiletId: this.listQuery.toiletId }).then(res => { if (res.code === 200) { - // this.score = res.data - this.score = 4.5 + this.score = res.data } }) }, diff --git a/src/views/overview/toiletLayer.vue b/src/views/overview/toiletLayer.vue index d5b4191..bb4cbda 100644 --- a/src/views/overview/toiletLayer.vue +++ b/src/views/overview/toiletLayer.vue @@ -102,8 +102,8 @@ }) }, // 将点加到地图上 - addPointOnMap: function(itemList, staffLayer, iconType) { - const { iconSize, iconAnchor, popupAnchor } = this + addPointOnMap: function(itemList, layer, iconType) { + const { map, iconSize, iconAnchor, popupAnchor } = this // 图标 const icon = Leaflet.icon({ iconUrl: iconType, @@ -121,15 +121,18 @@ '' + '' + '' + - '' + + '' + '' const popup = Leaflet.popup().setContent(popupStr) if (item.lng > 0 && item.lat > 0) { // 添加marker - const marker = Leaflet.marker([item.lat, item.lng], { icon: icon , item: item}).addTo(staffLayer).bindPopup(popup) + const marker = Leaflet.marker([item.lat, item.lng], { icon: icon, item: item }).addTo(layer).bindPopup(popup) marker.on('click', (e) => { - document.getElementById('detail').onclick = () => { + console.log('marker on click' + item.code) + const btn = document.getElementById('detail' + item.code) + console.log(btn) + btn.onclick = () => { console.log('click detail') this.detail(e.sourceTarget.options.item) } diff --git a/src/views/statistics/components/evaluationListDialog.vue b/src/views/statistics/components/evaluationListDialog.vue index 15a9c2f..1560772 100644 --- a/src/views/statistics/components/evaluationListDialog.vue +++ b/src/views/statistics/components/evaluationListDialog.vue @@ -16,7 +16,7 @@ diff --git a/src/api/sanitation/statistics.js b/src/api/sanitation/statistics.js index 2ca7549..ffeac18 100644 --- a/src/api/sanitation/statistics.js +++ b/src/api/sanitation/statistics.js @@ -11,3 +11,12 @@ 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 index 74181bc..11affd4 100644 --- a/src/api/sanitation/toilet.js +++ b/src/api/sanitation/toilet.js @@ -53,18 +53,17 @@ } // 公厕基本信息详情 -export function getToiletInfoDetail(params) { +export function getToiletInfoDetail(id) { return request({ - url: '/sanitation/toilet/listPage', - method: 'get', - params + url: '/sanitation/toilet/detail?toiletId=' + id, + method: 'get' }) } // 某公厕保洁记录 export function getRecordsByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + url: '/sanitation/toilet/jobRecord/detail', method: 'get', params }) @@ -73,12 +72,22 @@ // 某公厕平均评分 export function getScoreByToilet(params) { return request({ - url: '/sanitation/toilet/listPage', + 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() diff --git a/src/components/mapWindow/leafletMap.vue b/src/components/mapWindow/leafletMap.vue index 931a5e9..b753cc0 100644 --- a/src/components/mapWindow/leafletMap.vue +++ b/src/components/mapWindow/leafletMap.vue @@ -11,6 +11,16 @@ export default { name: 'LeafletMap', + props: { + minZoom: { + type: Number, + default: 14 + }, + maxZoom: { + type: Number, + default: 18 + } + }, data() { return { map: null, @@ -53,9 +63,10 @@ }, methods: { initMap() { + const { minZoom, maxZoom } = this const map = L.map(this.$refs.mapDiv, { - minZoom: 14, - maxZoom: 25, + minZoom: minZoom, + maxZoom: maxZoom, center: this.baseConfig.center, zoom: this.baseConfig.zoom, zoomControl: false, diff --git a/src/views/overview/toiletDetailDialog.vue b/src/views/overview/toiletDetailDialog.vue index 167d65e..def17bb 100644 --- a/src/views/overview/toiletDetailDialog.vue +++ b/src/views/overview/toiletDetailDialog.vue @@ -114,8 +114,8 @@ dialogFormVisible: false, listQuery: { toiletId: '', - beginDate: '', // 开始时间 - endDate: '', // 结束时间 + startTime: '', // 开始时间 + endTime: '', // 结束时间 offset: 1, limit: 5 }, // 筛选条件 @@ -168,8 +168,8 @@ this.title = item.name + '详情' this.listQuery = { toiletId: item.id, - beginDate: getLastMonth('yyyy-MM-dd'), - endDate: getToday('yyyy-MM-dd'), + startTime: getLastMonth('yyyy-MM-dd') + ' 00:00:00', + endTime: getToday('yyyy-MM-dd') + ' 23:59:59', offset: 1, limit: 5 } @@ -187,15 +187,17 @@ }, // 保洁记录 fetchCleanRecords() { + this.listLoading = true getRecordsByToilet(this.listQuery).then((res) => { - this.listLoading = true - this.list = [ - { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, - { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } - ] - this.total = 4 + this.list = res.data.rows + this.total = res.data.total + // this.list = [ + // { name: '张三', jobContent: '保洁', startTime: '2021-07-01 08:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-02 09:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-03 10:00:00' }, + // { name: '张三', jobContent: '保洁', startTime: '2021-07-04 11:00:00' } + // ] + // this.total = 4 this.listLoading = false }) }, @@ -203,8 +205,7 @@ fetchScoreData() { getScoreByToilet({ toiletId: this.listQuery.toiletId }).then(res => { if (res.code === 200) { - // this.score = res.data - this.score = 4.5 + this.score = res.data } }) }, diff --git a/src/views/overview/toiletLayer.vue b/src/views/overview/toiletLayer.vue index d5b4191..bb4cbda 100644 --- a/src/views/overview/toiletLayer.vue +++ b/src/views/overview/toiletLayer.vue @@ -102,8 +102,8 @@ }) }, // 将点加到地图上 - addPointOnMap: function(itemList, staffLayer, iconType) { - const { iconSize, iconAnchor, popupAnchor } = this + addPointOnMap: function(itemList, layer, iconType) { + const { map, iconSize, iconAnchor, popupAnchor } = this // 图标 const icon = Leaflet.icon({ iconUrl: iconType, @@ -121,15 +121,18 @@ '' + '' + '' + - '' + + '' + '' const popup = Leaflet.popup().setContent(popupStr) if (item.lng > 0 && item.lat > 0) { // 添加marker - const marker = Leaflet.marker([item.lat, item.lng], { icon: icon , item: item}).addTo(staffLayer).bindPopup(popup) + const marker = Leaflet.marker([item.lat, item.lng], { icon: icon, item: item }).addTo(layer).bindPopup(popup) marker.on('click', (e) => { - document.getElementById('detail').onclick = () => { + console.log('marker on click' + item.code) + const btn = document.getElementById('detail' + item.code) + console.log(btn) + btn.onclick = () => { console.log('click detail') this.detail(e.sourceTarget.options.item) } diff --git a/src/views/statistics/components/evaluationListDialog.vue b/src/views/statistics/components/evaluationListDialog.vue index 15a9c2f..1560772 100644 --- a/src/views/statistics/components/evaluationListDialog.vue +++ b/src/views/statistics/components/evaluationListDialog.vue @@ -16,7 +16,7 @@ diff --git a/src/views/statistics/evaluationAssessment.vue b/src/views/statistics/evaluationAssessment.vue index 2193f0e..28dedc5 100644 --- a/src/views/statistics/evaluationAssessment.vue +++ b/src/views/statistics/evaluationAssessment.vue @@ -1,7 +1,7 @@ @@ -55,15 +54,14 @@ diff --git a/src/views/statistics/evaluationAssessment.vue b/src/views/statistics/evaluationAssessment.vue index 2193f0e..28dedc5 100644 --- a/src/views/statistics/evaluationAssessment.vue +++ b/src/views/statistics/evaluationAssessment.vue @@ -1,7 +1,7 @@ @@ -55,15 +54,14 @@ diff --git a/src/views/statistics/evaluationAssessment.vue b/src/views/statistics/evaluationAssessment.vue index 2193f0e..28dedc5 100644 --- a/src/views/statistics/evaluationAssessment.vue +++ b/src/views/statistics/evaluationAssessment.vue @@ -1,7 +1,7 @@ @@ -55,15 +54,14 @@ diff --git a/src/views/statistics/evaluationAssessment.vue b/src/views/statistics/evaluationAssessment.vue index 2193f0e..28dedc5 100644 --- a/src/views/statistics/evaluationAssessment.vue +++ b/src/views/statistics/evaluationAssessment.vue @@ -1,7 +1,7 @@ @@ -55,15 +54,14 @@