jtoms 4 år sedan
förälder
incheckning
31fbc89e10
4 ändrade filer med 26 tillägg och 19 borttagningar
  1. 15 8
      src/api/place/base_info.js
  2. 1 1
      src/router/index.js
  3. 1 1
      src/views/place/baseInfo/index.vue
  4. 9 9
      src/views/place/gis/index.vue

+ 15 - 8
src/api/place/base_info.js

@@ -40,14 +40,6 @@ export function findAllDataType() {
   })
 }
 
-// export function findDataTypeExtendColumn(categoryId) {
-//   return request({
-//     url: '/bz/data/info/findDataTypeExtendColumn',
-//     method: 'post',
-//     params: { categoryId }
-//   })
-// }
-
 export function findDataBaseInfoExtends(baseInfoId, categoryId) {
   return request({
     url: '/bz/data/info/findDataBaseInfoExtends',
@@ -55,3 +47,18 @@ export function findDataBaseInfoExtends(baseInfoId, categoryId) {
     params: { baseInfoId, categoryId }
   })
 }
+
+export const findByMapBounds = (maxlng, maxlat, minlng, minlat, dataType) => {
+  return request({
+    url: '/bz/data/info/findByMapBounds',
+    method: 'POST',
+    params: { maxlng, maxlat, minlng, minlat, dataType }
+  })
+}
+
+export const findByGroupByDataType = () => {
+  return request({
+    url: '/bz/data/info/findByGroupByDataType',
+    method: 'POST'
+  })
+}

+ 1 - 1
src/router/index.js

@@ -165,7 +165,7 @@ export const asyncRoutes = [
       {
         path: 'gis',
         name: 'BzBaseGis',
-        component: () => import('@/views/bz/gis'),
+        component: () => import('@/views/place/gis'),
         meta: { title: 'GIS地图分布', authorities: ['place.base.info.gis.map'] }
       }
     ]

+ 1 - 1
src/views/place/baseInfo/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <el-form :model="queryForm" inline size="small">
       <el-form-item label="关键词">
-        <el-input v-model="queryForm.keyword" placeholder="关键词"/>
+        <el-input v-model="queryForm.name" placeholder="关键词"/>
       </el-form-item>
     </el-form>
     <el-row class="action-bar-container" type="flex" justify="end">

+ 9 - 9
src/views/bz/gis/index.vue → src/views/place/gis/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="app-container">
-    <tencent-map id="amapcontainer" :height="900" :enable-click="false" :enable-bounds-changed="true" @boundsChanged="boundsChanged" />
+    <tencent-map id="amapcontainer" :height="900" :enable-click="false" :enable-bounds-changed="true" @boundsChanged="boundsChanged"/>
     <div class="category">
       <el-card>
-        <a v-for="d in listData" :key="d.dataType.name" href="javascript:;" @click="changeDataType(d.dataType.name)">
+        <a v-for="d in listData" :key="d.category.id" href="javascript:;" @click="changeDataType(d.category.id)">
           <el-row>
             <el-col :span="18">
-              {{ d.dataType.text }}
+              {{ d.category.name }}
             </el-col>
             <el-col :span="6">
               {{ d.num }}
@@ -33,7 +33,7 @@
 </style>
 
 <script>
-import { findByGroupByDataType, findByMapBounds } from '@/api/bz/base/baseInfo'
+import { findByGroupByDataType, findByMapBounds } from '@/api/place/base_info'
 import TencentMap from '@/components/TencentMap'
 
 export default {
@@ -41,7 +41,7 @@ export default {
   data() {
     return {
       listData: [],
-      dataType: null,
+      categoryId: null,
       northEast: null,
       southWest: null,
       markerLayer: null
@@ -51,12 +51,13 @@ export default {
   },
   mounted() {
     findByGroupByDataType().then(v => {
+      console.log(v)
       this.listData = v
     })
   },
   methods: {
-    changeDataType: function(dataTypeName) {
-      this.dataType = dataTypeName
+    changeDataType: function(categoryId) {
+      this.categoryId = categoryId
       this.findData()
     },
     boundsChanged: function(northEast, southWest, markerLayer) {
@@ -67,7 +68,7 @@ export default {
     },
     findData() {
       const _this = this
-      findByMapBounds(_this.northEast.lng, _this.northEast.lat, _this.southWest.lng, _this.southWest.lat, _this.dataType)
+      findByMapBounds(_this.northEast.lng, _this.northEast.lat, _this.southWest.lng, _this.southWest.lat, _this.categoryId)
         .then((res) => _this.setMarker(res))
         .finally(() => (_this.isloading = false))
     },
@@ -75,7 +76,6 @@ export default {
       const listGeometries = []
       res.forEach((o) => {
         let infoContent = '<div style="text-align: left">'
-        infoContent += '<p>类型:' + (o.dataType.text ?? '-') + '</p>'
         infoContent += '<p>名称:' + (o.name ?? '-') + '</p>'
         infoContent += '<p>联系人:' + (o.contacts ?? '-') + '</p>'
         infoContent += '<p>电话:' + (o.contactNumber ?? '-') + '</p>'