无人机管理后台前端(已迁走)
shuishen
2025-07-17 67c1051591ce86d262e3423730a46e91f812b7ca
feat:事件工单---新建工单, 选择位置默认位置显示处理
1 files modified
15 ■■■■■ changed files
src/views/tickets/ticket.vue 15 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -741,6 +741,8 @@
    }
  },
  created () {
    this.inputMapShowDefaultCenter = null
    this.loadAMapScripts()
    this.fetchDropdownData()
    console.log('permission.tickets_processing_btn', this.permission.tickets_processing_btn)
@@ -1042,19 +1044,21 @@
        // 直接从返回对象中获取正确的路径
        const center = adcodeObj?.payload?.objects?.collection?.geometries?.[0]?.properties?.center
        if (Array.isArray(center) && center.length === 2) {
          this.mapParams.center = center
          this.inputMapShowDefaultCenter = center
        } else {
          // 如果找不到中心点,尝试使用 bbox 的中心点
          const bbox = adcodeObj?.payload?.bbox
          if (Array.isArray(bbox) && bbox.length === 4) {
            const centerX = (bbox[0] + bbox[2]) / 2
            const centerY = (bbox[1] + bbox[3]) / 2
            this.mapParams.center = [centerX, centerY]
            this.inputMapShowDefaultCenter = [centerX, centerY]
          } else {
            this.mapParams.center = [115.861365, 28.621311]
            this.inputMapShowDefaultCenter = [115.861365, 28.621311]
          }
        }
        this.mapParams.center = [...this.inputMapShowDefaultCenter]
        this.mapLoaded = true
      } catch (error) {
@@ -1526,10 +1530,9 @@
    },
    handleAdd () {
      this.createoredit = 1
      this.dialogVisible = true
      this.mapParams.center = null
      this.mapParams.center = [...this.inputMapShowDefaultCenter]
      this.form.location = []
    },
@@ -2137,7 +2140,7 @@
      if (Array.isArray(this.form.location) && this.form.location.length >= 2) {
        this.mapParams.center = [Number(this.form.location[0]), Number(this.form.location[1])]
      } else {
        this.mapParams.center = null // 没有经纬度时用默认
        this.mapParams.center = [...this.inputMapShowDefaultCenter]
      }
      // 如果有图片,添加到表单中
      if (row.photo_url) {