|
|
|
@ -133,12 +133,12 @@ export default {
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
dialogTitle: '编辑项目',
|
|
|
|
|
form: {
|
|
|
|
|
type: '外部', // 默认类型
|
|
|
|
|
images: [], // 上传的图片列表
|
|
|
|
|
type: '外部',
|
|
|
|
|
images: [],
|
|
|
|
|
},
|
|
|
|
|
fileList: [], // 上传的文件列表
|
|
|
|
|
map: null, // 地图实例
|
|
|
|
|
markerIcon: require('@/assets/images/detailsicon/icon-定位@2x.png'), // 使用 require 引入图片
|
|
|
|
|
markerIcon: require('@/assets/images/detailsicon/icon-定位@2x.png'),
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
@ -167,16 +167,14 @@ export default {
|
|
|
|
|
handleEdit() {
|
|
|
|
|
this.dialogTitle = '编辑项目';
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
// 填充表单数据
|
|
|
|
|
this.form = {
|
|
|
|
|
type: '外部', // 默认类型
|
|
|
|
|
images: [], // 上传的图片列表
|
|
|
|
|
type: '外部',
|
|
|
|
|
images: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
// 提交表单
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
// 调用 API 提交数据
|
|
|
|
|
addxmt(this.form).then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success('数据提交成功!');
|
|
|
|
@ -196,15 +194,14 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
addTestMarker() {
|
|
|
|
|
const graphic = new mars2d.graphic.Marker({
|
|
|
|
|
latlng: [31.3256, 120.7457], //xxxx的坐标
|
|
|
|
|
latlng: [31.3256, 120.7457],
|
|
|
|
|
style: {
|
|
|
|
|
image: this.markerIcon, // 使用引入的图片路径
|
|
|
|
|
image: this.markerIcon,
|
|
|
|
|
width: 46,
|
|
|
|
|
height: 60,
|
|
|
|
|
horizontalOrigin: mars2d.HorizontalOrigin.CENTER,
|
|
|
|
|
verticalOrigin: mars2d.VerticalOrigin.BOTTOM
|
|
|
|
|
},
|
|
|
|
|
// attr: { remark: "xxxx的坐标" }
|
|
|
|
|
});
|
|
|
|
|
this.map.graphicLayer.addGraphic(graphic);
|
|
|
|
|
}
|
|
|
|
|