Browse Source

添加查看教学点

wolyshaw 4 years ago
parent
commit
a04ba5636d

+ 49 - 0
src/views/teamDetail/components/modals/school-location.vue

@@ -0,0 +1,49 @@
+<template>
+  <el-amap
+    :zoom="14"
+    ref="map"
+    vid="amapDemo"
+    style="height: 300px;"
+    :amap-manager="amapManager"
+    :center="center"
+    class="amap-demo"
+  >
+    <el-amap-marker
+      :position="center"
+      title="教学点"
+    ></el-amap-marker>
+    <el-amap-text
+      :text="address"
+      :position="center"
+      :offset="[0, 20]"
+    ></el-amap-text>
+  </el-amap>
+</template>
+<script>
+import VueAMap from "vue-amap";
+let amapManager = new VueAMap.AMapManager();
+VueAMap.initAMapApiLoader({
+  key: "b1e6ac2eb28902ce91a490edf194e000",
+  plugin: [
+    "Autocomplete",
+    "PlaceSearch",
+    "Scale",
+    "OverView",
+    "ToolBar",
+    "MapType",
+    "PolyEditor",
+    "AMap.CircleEditor",
+  ],
+  v: "1.4.4",
+});
+export default {
+  props: ['longitudeLatitude', 'address'],
+  data() {
+    console.log(this.address)
+    return {
+      amapManager,
+      center: (this.longitudeLatitude || '').split(',')
+    }
+  }
+};
+</script>

+ 16 - 1
src/views/teamDetail/teamCourseList.vue

@@ -361,6 +361,12 @@
             </el-tooltip>
           </div>
         </el-form-item>
+        <el-form-item v-if="maskForm.school" label="教学点">
+          {{ maskForm.school.name }}
+          <el-tooltip content="查看教学点" :open-delay=".5">
+            <i @click="openLocation(maskForm.school)" class="el-icon-map-location" style="cursor: pointer;"></i>
+          </el-tooltip>
+        </el-form-item>
 
       </el-form>
       <!--  v-if="maskForm.status != 'NOT_START'" -->
@@ -420,6 +426,9 @@
                   @getList='getList'
                   :id='id' />
     </el-dialog>
+    <el-dialog title="查看教学点" :visible.sync="locationVisible">
+      <school-location v-if="maskForm.school" :longitudeLatitude="maskForm.school.longitudeLatitude" :address="maskForm.school.address"/>
+    </el-dialog>
     <addCompound :compoundList='compoundList' v-if="permission('courseSchedule/courseMerge')"
                  @clearCom='clearCom'
                  @getList='getList'
@@ -448,6 +457,7 @@ import { permission } from "@/utils/directivePage";
 import axios from "axios";
 import { getToken } from "@/utils/auth";
 import load from "@/utils/loading";
+import SchoolLocation from './components/modals/school-location'
 import resetClass from './componentCourse/resetClass'
 import teacherList from './componentCourse/teacherList'
 import addCompound from './componentCourse/addCompound'
@@ -481,6 +491,7 @@ export default {
       classVisible: false,
       timerVisible: false,
       courseVisible: false,
+      locationVisible: false,
       courseType: courseType,
       mergeCourseType,
       courseListType: courseListType,
@@ -513,7 +524,8 @@ export default {
     resetClass,
     teacherList,
     addCompound,
-    infoMsg
+    infoMsg,
+    SchoolLocation
   },
   activated () {
     this.init();
@@ -587,6 +599,9 @@ export default {
         ...getTimes(timer, ['startTime', 'endTime']),
       }
     },
+    openLocation(school) {
+      this.locationVisible = true
+    },
     onCourseExport () {
       // 课表导出
       let url = "/api-web/export/superFindCourseSchedules";