From e36eed2cdc9335fc4d1b84c8e4e306422638542f Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 27 十一月 2024 08:53:51 +0800
Subject: [PATCH] ll

---
 admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue |   54 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue b/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue
index 00acdd2..ca12d05 100644
--- a/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue
+++ b/admin/src/views/Inspection/components/OperaYwPatrolPointWindow.vue
@@ -30,7 +30,7 @@
         <el-input type="textarea" :rows="4" v-model="form.content" placeholder="璇疯緭鍏�" />
       </el-form-item>
       <el-form-item label="涓婁紶鍥剧墖" prop="imgurl">
-        <UploadAvatarImage :file="{ 'imgurlfull': form.imgurlfull, 'imgurl': form.imgurl }"
+        <UploadAvatarImage :file="{ 'imgurlfull': form.fileFullUrl, 'imgurl': form.fileurl }"
           :uploadData="{ folder: 'ywPatrol/' }" @uploadSuccess="uploadAvatarSuccess" @uploadEnd="isUploading = false"
           @uploadBegin="isUploading = true" />
       </el-form-item>
@@ -45,6 +45,7 @@
 import mapDrag from '@/components/common/map/mapDrag.vue'
 import { fetchList } from '@/api/business/category'
 import { detail } from '@/api/Inspection/ywPatrolPoint'
+import { fetchList as getDeiceList } from '@/api/Inspection/device'
 export default {
   name: 'OperaYwPatrolPointWindow',
   extends: BaseOpera,
@@ -81,50 +82,57 @@
     open(title, row) {
       this.title = title
       this.visible = true
+      this.initData()
       if (row && row.id) {
         this.getDetail(row)
       }
     },
     getDetail(row) {
       detail(row.id).then(res => {
-        this.form = { ...res } 
+        this.form = { ...res }
         // this.$set(this.form, 'areaId', res.areaId)
         // console.log('res', res)
         // console.log('res', this.form)
-        this.initData(res.areaId)
+
       })
     },
-    initData(areaId) {
+    initData() {
       fetchList({
         model: { type: 4 },
         capacity: 1000,
         page: 1,
       }).then(res => {
         this.cateList = res.records || []
-        console.log('this.form.areaId', this.form)
-
-        if (areaId) {
-          this.cateList.forEach(item => {
-            if (item.childCategoryList) {
-              item.childCategoryList.forEach(item2 => {
-                if (item2.id == areaId) {
-                  this.$set(this.form, 'areaIds', [item.id, item2.id])
-                  console.log('areaIds', this.form)
-
-                }
-              })
-            }
-          })
-        }
+        setTimeout(() => {
+          const areaId = this.form.areaId
+          if (areaId) {
+            this.cateList.forEach(item => {
+              if (item.childCategoryList) {
+                item.childCategoryList.forEach(item2 => {
+                  if (item2.id == areaId) {
+                    this.$set(this.form, 'areaIds', [item.id, item2.id])
+                  }
+                })
+              }
+            })
+          }
+        }, 1300)
+      })
+      getDeiceList({
+        model: {},
+        capacity: 1000,
+        page: 1,
+      }).then(res => {
+        this.deviceList = res.records
       })
 
     },
     getCenter(data) {
       // console.log(data)
       // this.$set(this.form, 'postion', data.address)
-      if(data.lng){
+      if (data.lng) {
         this.$set(this.form, 'lnglat', data.lng + ',' + data.lat)
-      }else{
+      } else {
         this.$set(this.form, 'lnglat', '')
       }
       this.$set(this.form, 'longitude', data.lng)
@@ -138,8 +146,8 @@
       }
     },
     uploadAvatarSuccess(file) {
-      this.form.imgurl = file.imgurl
-      this.form.imgurlfull = file.imgurlfull
+      this.form.fileurl = file.imgurl
+      this.form.fileFullUrl = file.imgurlfull
     },
   }
 }

--
Gitblit v1.9.3