MONSTER-ygh 1 год назад
Родитель
Сommit
eb586756e7

+ 2 - 1
public/index.html

@@ -8,7 +8,8 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= webpackConfig.name %></title>
     <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
-	  <style>
+    <script src="https://map.qq.com/api/gljs?v=1.exp&key=BCDBZ-SY2LL-D57PJ-MVO7X-QVWX3-UCBN6"></script>
+    <style>
     html,
     body,
     #app {

+ 69 - 0
src/myComponents/qqMap.vue

@@ -0,0 +1,69 @@
+<template>
+    <!-- <div>
+        <a-input-search
+      placeholder="请输入搜索的地址"
+      @search="onSearch"
+      enterButton="Search"
+      style="width: 300px;margin-left: 20px;"
+    />
+    </div> -->
+    <div id="mapBox" style="width: 100%; height: 100%;"></div>
+  </template>
+   
+  <script>
+  export default {
+    name: 'TencentMap',
+    data() {
+        return {
+            map: null,
+            markerLayer: null
+        }
+    },
+    mounted() {
+      // 初始化地图
+      this.initMap({});
+    },
+    methods: {
+        initMap(params) {
+            //定义地图中心点坐标
+            let center = new TMap.LatLng(params.lat||39.916527, params.lng||116.397128)
+            //定义map变量,调用 TMap.Map() 构造函数创建地图
+            this.map = new TMap.Map(document.getElementById('mapBox'), {
+                center: center,//设置地图中心点坐标
+                zoom: 17.2,   //设置地图缩放级别
+                pitch: 43.5,  //设置俯仰角
+                rotation: 45    //设置地图旋转角度
+            });
+            if(params.lat) {
+                this.setMakerLayer(params,false)
+            }
+            //监听点击事件添加marker
+            this.map.on("click", (evt) => {
+                this.setMakerLayer(evt.latLng)
+                this.$emit('setDot',{
+                    ...evt.latLng
+                })                    
+            });
+        },
+        setMakerLayer(params,type){
+            if(type) {
+                let center = new TMap.LatLng(params.lat||39.916527, params.lng||116.397128)
+                this.map.setCenter(center);
+            }
+            if(this.markerLayer){
+                this.markerLayer.setMap(null)
+            }
+            if(params.lat){
+                this.markerLayer = new TMap.MultiMarker({
+                    id: 'marker-layer',
+                    map: this.map
+                })
+                this.markerLayer.add({
+                    position: params
+                });
+            }
+            
+        }
+    }
+  }
+  </script>

+ 2 - 2
src/views/tourism/scenicAreaManagement/contentManagement/attractionInfoManagement.vue

@@ -149,7 +149,7 @@
     components: {addAndEdit},
     data() {
       return {
-        title: "景管理",// 通用标题
+        title: "景管理",// 通用标题
         configPermi: {
           add: ['system:user:edit'], // 新增权限
           details: ['system:user:details'], // 详情权限
@@ -259,7 +259,7 @@
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+        this.$modal.confirm('是否确认删除数据项?').then( () => {
           return delTableParamsApi(this.configUrl.delect,{
             id: ids
           });

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/carouselAdvertis.vue

@@ -281,7 +281,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+      this.$modal.confirm('是否确认删除数据项?').then( () => {
         return delTableParamsApi(this.configUrl.delect,{
           id: ids
         });

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/eventNotifications.vue

@@ -276,7 +276,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+      this.$modal.confirm('是否确认删除数据项?').then( () => {
         return delTableApi(this.configUrl.delect,ids);
       }).then(() => {
         this.getList();

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/formBox/attractionInfoManagementForm.vue

@@ -83,7 +83,7 @@
         </el-form-item>
         <el-form-item label="开/闭园:" prop="status">
           <el-switch
-              style="display: block;margin-top: 5px;"
+              style="display: block;margin-top: 8px;"
               v-model="form.status"
               active-color="#13ce66"
               inactive-color="#ccc"

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/noticeManagement.vue

@@ -222,7 +222,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+      this.$modal.confirm('是否确认删除数据项?').then( () => {
         return delTableParamsApi(this.configUrl.delect,{
           id: ids
         });

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/questions.vue

@@ -230,7 +230,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+      this.$modal.confirm('是否确认删除数据项?').then( () => {
         return delTableParamsApi(this.configUrl.delect,{
           id: ids
         });

+ 25 - 4
src/views/tourism/scenicAreaManagement/contentManagement/tabelBox/attractionInfoBeas.vue

@@ -39,13 +39,14 @@
               style="width: 300px"
             />
           </el-form-item>
-          <div>
+          <div style="display: flex;">
             <el-form-item label="经度" prop="longitude">
                 <el-input
                 v-model="form.longitude"
                 placeholder="请输入经度"
                 clearable
                 style="width: 300px"
+                readonly
                 />
             </el-form-item>
             <el-form-item label="纬度" prop="latitude">
@@ -55,11 +56,14 @@
                 placeholder="请输入纬度"
                 clearable
                 style="width: 300px"
+                readonly
                 />
             </el-form-item>   
           </div>
-          
-          <el-form-item>
+          <div style="width: 100%;height: 300px;">
+            <qqMapBox ref="qqMapBox" @setDot="setDot" />
+          </div>
+          <el-form-item style="margin-top: 15px;">
             <el-button
                 type="primary"
                 @click="submitForm"
@@ -79,10 +83,11 @@ import {
   getTableDeatilsByIdApi,
   updateTableApi,
  } from '@/api/CURD'
+ import qqMapBox from '@/myComponents/qqMap.vue'
 export default {
   name: "AttractionInfoBeas",
   dicts: [],
-  components: {},
+  components: {qqMapBox},
   data() {
     return {
         title: "基本信息",// 通用标题
@@ -130,6 +135,18 @@ export default {
         }
           this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
           this.formStatus = 1
+          this.$nextTick(()=>{
+            if(this.form.longitude&&this.form.latitude){
+              console.log("dsfasfdasdfasdfadsfads")
+              this.$refs.qqMapBox.setMakerLayer({
+                height: 0,
+                lat: this.form.latitude,
+                lng: this.form.longitude,
+              },true)
+            }
+            
+          })
+          
         }else {
           this.$message.error('获取详情失败!!!');
           this.formStatus = 2
@@ -181,6 +198,10 @@ export default {
         this.$refs["form"].clearValidate();
       }
     },
+    setDot(params){
+      this.$set(this.form,'longitude',params.lng)
+      this.$set(this.form,'latitude',params.lat)
+    }
   },
 }
 </script>

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/tabelBox/attractionInfoCulture.vue

@@ -280,7 +280,7 @@
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+        this.$modal.confirm('是否确认删除数据项?').then( () => {
           return delTableParamsApi(this.configUrl.delect,{
             id: ids,
             type: 1

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/tabelBox/attractionInfoIntroduce.vue

@@ -280,7 +280,7 @@
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+        this.$modal.confirm('是否确认删除数据项?').then( () => {
           return delTableParamsApi(this.configUrl.delect,{
             id: ids,
             type: 1

+ 1 - 1
src/views/tourism/scenicAreaManagement/contentManagement/tourismStrategy.vue

@@ -251,7 +251,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+      this.$modal.confirm('是否确认删除数据项?').then( () => {
         return delTableParamsApi(this.configUrl.delect,{
           id: ids
         });

+ 38 - 5
src/views/tourism/scenicAreaManagement/navigationManagement/formBox/scenicGuideForm.vue

@@ -29,16 +29,16 @@
         <el-form-item label="地图定位:">
           <div style="display: flex;">
             <el-form-item label="经度:" label-width="80px" prop="longitude">
-              <el-input style="width: 350px;" v-model="form.longitude" placeholder="请输入点位名称" />
+              <el-input style="width: 350px;" readonly v-model="form.longitude" placeholder="请输入点位名称" />
             </el-form-item>
             <el-form-item label="纬度:" prop="latitude">
-              <el-input style="width: 350px;" v-model="form.latitude" placeholder="请输入点位名称" />
+              <el-input style="width: 350px;" readonly v-model="form.latitude" placeholder="请输入点位名称" />
             </el-form-item>
           </div>
         </el-form-item>
         <!-- 腾讯地图  -->
-        <div>
-
+        <div style="width: 100%;height: 300px;">
+          <qqMapBox ref="qqMapBox" @setDot="setDot" />
         </div>
       </el-form>
     </div>
@@ -66,10 +66,11 @@ import {
   addTableApi,
   listTableApi
  } from '@/api/CURD'
-
+ import qqMapBox from '@/myComponents/qqMap.vue'
 export default {
   name: "addAndEdit",
   dicts: [],
+  components: {qqMapBox},
   data() {
     return {
       title: "",
@@ -111,6 +112,15 @@ export default {
       if(model=='ADD') { // 新增
         this.$set(this,'form',row)
         this.formStatus = 1
+        this.$nextTick(()=>{
+          if(this.form.longitude&&this.form.latitude){
+              this.$refs.qqMapBox.setMakerLayer({
+                height: 0,
+                lat: null,
+                lng: null,
+              },true)
+          }
+      })
       }else if(model=='EDIT') { // 新增
         let obj = {
           ...row,
@@ -118,6 +128,15 @@ export default {
         }
         this.$set(this,'form',obj)
         this.formStatus = 1
+        this.$nextTick(()=>{
+          if(this.form.longitude&&this.form.latitude){
+              this.$refs.qqMapBox.setMakerLayer({
+                height: 0,
+                lat: this.form.latitude,
+                lng: this.form.longitude,
+              },true)
+          }
+      })
       }else if(model=='EDITInit') { // 新增
         await this.getTableDeatilsFun(row)
       }
@@ -140,6 +159,16 @@ export default {
           }
           this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
           this.formStatus = 1
+          this.$nextTick(()=>{
+            if(this.form.longitude&&this.form.latitude){
+              this.$refs.qqMapBox.setMakerLayer({
+                height: 0,
+                lat: this.form.latitude,
+                lng: this.form.longitude,
+              },true)
+            }
+            
+          })
         }else {
           this.$message.error('获取详情失败!!!');
           this.formStatus = 2
@@ -228,6 +257,10 @@ export default {
         this.pointTypeList = [];
       }) 
     },
+    setDot(params){
+      this.$set(this.form,'longitude',params.lng)
+      this.$set(this.form,'latitude',params.lat)
+    }
   },
 };
 </script>

+ 1 - 1
src/views/tourism/scenicAreaManagement/navigationManagement/pointType.vue

@@ -235,7 +235,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+      this.$modal.confirm('您确定要将该类型及点位信息一并删除吗?').then( () => {
         return delTableParamsApi(this.configUrl.delect,{
           id: ids
         });

+ 1 - 1
src/views/tourism/scenicAreaManagement/navigationManagement/scenicGuide.vue

@@ -245,7 +245,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then( () => {
+      this.$modal.confirm('是否确认删除数据项?').then( () => {
         return delTableParamsApi(this.configUrl.delect,{
           id: ids
         });