whj 1 year ago
parent
commit
62abb0cf99
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/views/sb/info/modules/PointModal.vue

+ 9 - 2
src/views/sb/info/modules/PointModal.vue

@@ -15,8 +15,9 @@
       </row-list>
     </a-form>
     <div @click="handleSelectPoint" style="position: relative;">
-      <div class="point" ref="point"></div>
-      <img src="@/assets/a/a.png" width="100%" alt="">
+      <div v-show="x" class="point" ref="point"></div>
+      <img v-if="url" :src="url" width="100%" alt="">
+      <a-empty v-else description="暂无底图,请上传" />
     </div>
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
@@ -25,6 +26,7 @@
 </template>
 
 <script>
+import { fetchSbPosition } from '@/api/sb/position'
 export default {
   name: 'PointModal',
   data() {
@@ -35,6 +37,7 @@ export default {
       y: null,
       visible: false,
       record: {},
+      url: null,
     }
   },
   props: {},
@@ -52,6 +55,9 @@ export default {
       this.$nextTick(() => {
         this.$refs.point.style.left = this.x + 'px'
         this.$refs.point.style.top = this.y + 'px'
+        fetchSbPosition({ id: record.positionId }).then((res) => {
+          this.url = res.data.opcImg
+        })
       })
     },
     save() {
@@ -72,6 +78,7 @@ export default {
       this.$emit('ok')
       this.x = null
       this.y = null
+      this.record = null
       this.confirmLoading = false
     },
   },