|
@ -9,20 +9,29 @@ |
|
|
:disabled="formType === 'detail'" |
|
|
:disabled="formType === 'detail'" |
|
|
class="form" |
|
|
class="form" |
|
|
> |
|
|
> |
|
|
|
|
|
<el-form-item |
|
|
<el-form-item label="头像" label-width="150px" |
|
|
label="头像" |
|
|
|
|
|
label-width="150px" |
|
|
prop="imageList" |
|
|
prop="imageList" |
|
|
style="display: block"> |
|
|
style="display: block" |
|
|
|
|
|
> |
|
|
<div class="imsg-list"> |
|
|
<div class="imsg-list"> |
|
|
<div v-for="(item, index) in dataForm.imageList" :key="index" class="imgs-item"> |
|
|
<div |
|
|
|
|
|
v-for="(item, index) in dataForm.imageList" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
class="imgs-item" |
|
|
|
|
|
> |
|
|
<el-image |
|
|
<el-image |
|
|
style="width: 100px; height: 100px" |
|
|
style="width: 100px; height: 100px" |
|
|
:src="item" |
|
|
:src="item" |
|
|
fit="fill" |
|
|
fit="fill" |
|
|
:preview-src-list="dataForm.imageList"></el-image> |
|
|
:preview-src-list="dataForm.imageList" |
|
|
|
|
|
></el-image> |
|
|
<i class="el-icon-delete" @click="handleDelimg(item, index)"></i> |
|
|
<i class="el-icon-delete" @click="handleDelimg(item, index)"></i> |
|
|
</div> |
|
|
</div> |
|
|
<el-upload :headers="$getElUploadHeaders()" class="avatar-uploader" |
|
|
<el-upload |
|
|
|
|
|
:headers="$getElUploadHeaders()" |
|
|
|
|
|
class="avatar-uploader" |
|
|
v-if="dataForm.imageList.length < 1 && !disabled" |
|
|
v-if="dataForm.imageList.length < 1 && !disabled" |
|
|
:action="uploadUlr" |
|
|
:action="uploadUlr" |
|
|
:data="{ customerId: customerId }" |
|
|
:data="{ customerId: customerId }" |
|
@ -31,10 +40,15 @@ |
|
|
:on-progress="handleProgress" |
|
|
:on-progress="handleProgress" |
|
|
:on-success="handleImgSuccess" |
|
|
:on-success="handleImgSuccess" |
|
|
:before-upload="beforeImgUpload" |
|
|
:before-upload="beforeImgUpload" |
|
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"> |
|
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP" |
|
|
<el-progress v-if="uploading" :width="100" type="circle" :percentage="unloadPencent"></el-progress> |
|
|
> |
|
|
|
|
|
<el-progress |
|
|
|
|
|
v-if="uploading" |
|
|
|
|
|
:width="100" |
|
|
|
|
|
type="circle" |
|
|
|
|
|
:percentage="unloadPencent" |
|
|
|
|
|
></el-progress> |
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i> |
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i> |
|
|
|
|
|
|
|
|
</el-upload> |
|
|
</el-upload> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -203,8 +217,7 @@ |
|
|
:disabled="btnDisable" |
|
|
:disabled="btnDisable" |
|
|
@click="handleComfirm" |
|
|
@click="handleComfirm" |
|
|
>确 定 |
|
|
>确 定 |
|
|
</el-button |
|
|
</el-button> |
|
|
> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@ -223,11 +236,11 @@ let loading; // 加载动画 |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', |
|
|
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", |
|
|
btnLoading: false, |
|
|
btnLoading: false, |
|
|
uploading: false, |
|
|
uploading: false, |
|
|
disabled: false, |
|
|
disabled: false, |
|
|
customerId: '', |
|
|
customerId: "", |
|
|
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
|
|
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
|
|
|
|
|
agencyId: "", |
|
|
agencyId: "", |
|
@ -316,7 +329,7 @@ export default { |
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
map = new window.TMap.Map(document.getElementById("app"), { |
|
|
map = new window.TMap.Map(document.getElementById("app"), { |
|
|
center: center, // 设置地图中心点坐标 |
|
|
center: center, // 设置地图中心点坐标 |
|
|
zoom: 17.2, // 设置地图缩放级别 |
|
|
zoom: 16.2, // 设置地图缩放级别 |
|
|
pitch: 43.5, // 设置俯仰角 |
|
|
pitch: 43.5, // 设置俯仰角 |
|
|
rotation: 45, // 设置地图旋转角度 |
|
|
rotation: 45, // 设置地图旋转角度 |
|
|
}); |
|
|
}); |
|
@ -358,9 +371,11 @@ export default { |
|
|
markers.setGeometries([]); |
|
|
markers.setGeometries([]); |
|
|
// 在地图显示范围内以给定的关键字搜索地点 |
|
|
// 在地图显示范围内以给定的关键字搜索地点 |
|
|
search |
|
|
search |
|
|
.searchRectangle({ |
|
|
.searchNearby({ |
|
|
keyword: this.dataForm.address, |
|
|
keyword: this.dataForm.address, |
|
|
bounds: map.getBounds(), |
|
|
radius: 1000, |
|
|
|
|
|
autoExtend: true, |
|
|
|
|
|
center: map.getCenter(), |
|
|
}) |
|
|
}) |
|
|
.then((result) => { |
|
|
.then((result) => { |
|
|
let { data } = result; |
|
|
let { data } = result; |
|
@ -378,32 +393,32 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
beforeImgUpload(file) { |
|
|
beforeImgUpload(file) { |
|
|
const isPNG = (file.type === 'image/png') || (file.type === 'image/jpeg') |
|
|
const isPNG = file.type === "image/png" || file.type === "image/jpeg"; |
|
|
const isLt1M = file.size / 1024 / 1024 < 10 |
|
|
const isLt1M = file.size / 1024 / 1024 < 10; |
|
|
|
|
|
|
|
|
if (!isPNG) { |
|
|
if (!isPNG) { |
|
|
this.$message.error('上传图片只能是 PNG 或 JPEG 格式!') |
|
|
this.$message.error("上传图片只能是 PNG 或 JPEG 格式!"); |
|
|
} |
|
|
} |
|
|
if (!isLt1M) { |
|
|
if (!isLt1M) { |
|
|
this.$message.error('上传图片大小不能超过 10MB!') |
|
|
this.$message.error("上传图片大小不能超过 10MB!"); |
|
|
} |
|
|
} |
|
|
return isPNG && isLt1M |
|
|
return isPNG && isLt1M; |
|
|
}, |
|
|
}, |
|
|
handleProgress(event, file, fileList) { |
|
|
handleProgress(event, file, fileList) { |
|
|
this.uploading = true |
|
|
this.uploading = true; |
|
|
this.unloadPencent = Number(file.percentage.toFixed(0)) |
|
|
this.unloadPencent = Number(file.percentage.toFixed(0)); |
|
|
}, |
|
|
}, |
|
|
handleImgSuccess(res, file) { |
|
|
handleImgSuccess(res, file) { |
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
if (res.code === 0 && res.msg === "success") { |
|
|
this.uploading = false |
|
|
this.uploading = false; |
|
|
this.unloadPencent = 0 |
|
|
this.unloadPencent = 0; |
|
|
this.dataForm.imageList.push(res.data.url) |
|
|
this.dataForm.imageList.push(res.data.url); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(res.msg) |
|
|
this.$message.error(res.msg); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleDelimg(item, index) { |
|
|
handleDelimg(item, index) { |
|
|
this.dataForm.imageList.splice(index, 1) |
|
|
this.dataForm.imageList.splice(index, 1); |
|
|
}, |
|
|
}, |
|
|
handleMoveCenter() { |
|
|
handleMoveCenter() { |
|
|
//修改地图中心点 |
|
|
//修改地图中心点 |
|
@ -419,7 +434,7 @@ export default { |
|
|
this.$refs.ref_form.resetFields(); |
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
|
|
|
|
|
this.formType = type; |
|
|
this.formType = type; |
|
|
this.dataForm.imageList = [] |
|
|
this.dataForm.imageList = []; |
|
|
if (row) { |
|
|
if (row) { |
|
|
this.dataForm = { ...this.dataForm, ...row }; |
|
|
this.dataForm = { ...this.dataForm, ...row }; |
|
|
if (row.imgUrl) { |
|
|
if (row.imgUrl) { |
|
@ -485,7 +500,6 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async submit() { |
|
|
async submit() { |
|
|
|
|
|
|
|
|
let url = ""; |
|
|
let url = ""; |
|
|
if (this.formType === "add") { |
|
|
if (this.formType === "add") { |
|
|
url = "/heart/societyorg/add"; |
|
|
url = "/heart/societyorg/add"; |
|
@ -535,7 +549,6 @@ export default { |
|
|
latitude: "", |
|
|
latitude: "", |
|
|
imageList:[] |
|
|
imageList:[] |
|
|
};*/ |
|
|
};*/ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 开启加载动画 |
|
|
// 开启加载动画 |
|
|
startLoading() { |
|
|
startLoading() { |
|
@ -597,15 +610,14 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.avatar-uploader { |
|
|
.avatar-uploader { |
|
|
::v-deep |
|
|
::v-deep .el-upload { |
|
|
.el-upload { |
|
|
|
|
|
cursor: pointer; |
|
|
cursor: pointer; |
|
|
position: relative; |
|
|
position: relative; |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.el-upload:hover { |
|
|
.el-upload:hover { |
|
|
border-color: #409EFF; |
|
|
border-color: #409eff; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.avatar { |
|
|
.avatar { |
|
|