| | |
| | | <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> |
| | |
| | | <!-- 上传图片 --> |
| | | <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> |
| | |
| | | } |
| | | }, |
| | | |
| | | 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 = []; |
| | |
| | | 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 = [{ |