无人机管理后台前端(已迁走)
rain
2025-04-17 d55a33cb87fb5261640d366bc1d38801ccd6c60d
地图地址回显
1 files modified
46 ■■■■■ changed files
src/views/tickets/ticket.vue 46 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -115,7 +115,9 @@
                      <i class="el-icon-map-location"></i> 地图选点
                    </el-button>
                  </avue-input-map>
                  <div v-if="form.location?.length >= 2" class="location-text">{{ form.address || '获取地址中...' }}</div>
                  <!-- <div v-if="form.location?.length >= 3">
  {{ form.location[2] || '获取地址中...' }}
</div> -->
                </div>
              </el-form-item>
            </el-col>
@@ -263,9 +265,9 @@
        <!-- 上传图片 -->
        <div v-if="[3, 4].includes(currentDetail.status)" class="form-section" style="margin-bottom: 32px;">
          <div class="section-title"  v-if="hasProcessedAndOverBtnPermission()">上传图片</div>
          <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
            :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload" :file-list="[]"
            :limit="1" accept="image/*">
          <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false"
            list-type="picture-card" :on-change="handleFileChange" :on-remove="handleUploadRemove"
            :before-upload="beforeUpload" :file-list="[]" :limit="1" accept="image/*">
            <span
              style="font-size: 32px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;">+</span>
          </el-upload>
@@ -1080,14 +1082,15 @@
    }
    },
    async handleLocationChange(val) {
      // 处理 Proxy 对象的值
    handleLocationChange(val) {
      let locationValue = val.value;
      if (locationValue && locationValue.length >= 3) {
        // 确保我们获取到实际的数组值
        this.form.location = [locationValue[0], locationValue[1]];
      if (locationValue && locationValue.length >= 2) {
        // 兼容第三项为地址
        this.form.location = [
          Number(locationValue[0]),
          Number(locationValue[1]),
          locationValue[2] || ''
        ];
        this.form.address = locationValue[2] || '';
      } else {
        this.form.location = [];
@@ -1696,12 +1699,27 @@
        department: deptId,
        handler: handlerId, // 使用映射后的处理人ID
        algorithm: algorithmArr, // 回显为数组
        location: row.location,
        address: row.address,
        location: Array.isArray(row.location) && row.location.length >= 2
          ? [Number(row.location[0]), Number(row.location[1])]
          : [],
        address: row.address || '',
        content: row.content,
        photos: [],
      };
      this.form.location = Array.isArray(row.location) && row.location.length >= 2
        ? [
          Number(row.location[0]),
          Number(row.location[1]),
          row.location[2] || row.address || ''
        ]
        : [];
      this.form.address = this.form.location[2] || '';
      // 设置地图中心点
      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; // 没有经纬度时用默认
      }
      // 如果有图片,添加到表单中
      if (row.photo_url) {
        this.form.photos = [{