|
@@ -46,6 +46,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import AddressPicker from '@/components/address-picker.vue'
|
|
import AddressPicker from '@/components/address-picker.vue'
|
|
|
|
|
+import { matchByStreet, countFamiliesByStreetIds, countTeachersByStreetIds } from '@/utils/api.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -74,7 +75,7 @@ export default {
|
|
|
this.matching = true
|
|
this.matching = true
|
|
|
try {
|
|
try {
|
|
|
// 获取匹配范围
|
|
// 获取匹配范围
|
|
|
- const matchRes = await this.$http.get(`/api/streets/${this.filterStreetId}/match`)
|
|
|
|
|
|
|
+ const matchRes = await matchByStreet(this.filterStreetId)
|
|
|
this.matchResult = matchRes.data
|
|
this.matchResult = matchRes.data
|
|
|
|
|
|
|
|
// 统计各级别的家庭数
|
|
// 统计各级别的家庭数
|
|
@@ -103,9 +104,7 @@ export default {
|
|
|
async countFamilies(streetIds) {
|
|
async countFamilies(streetIds) {
|
|
|
if (!streetIds || streetIds.length === 0) return 0
|
|
if (!streetIds || streetIds.length === 0) return 0
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.$http.get('/api/admin/families/count', {
|
|
|
|
|
- params: { streetIds: streetIds.join(',') }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const res = await countFamiliesByStreetIds(streetIds)
|
|
|
return res.data || 0
|
|
return res.data || 0
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
return 0
|
|
return 0
|
|
@@ -115,9 +114,7 @@ export default {
|
|
|
async countTeachers(streetIds) {
|
|
async countTeachers(streetIds) {
|
|
|
if (!streetIds || streetIds.length === 0) return 0
|
|
if (!streetIds || streetIds.length === 0) return 0
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.$http.get('/api/admin/teachers/count', {
|
|
|
|
|
- params: { streetIds: streetIds.join(',') }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const res = await countTeachersByStreetIds(streetIds)
|
|
|
return res.data || 0
|
|
return res.data || 0
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
return 0
|
|
return 0
|