Commit a23474b9 authored by 纪泽龙's avatar 纪泽龙

更改组件

parent 794299a3
<!--
* @Author: your name
* @Date: 2022-02-12 11:07:10
* @LastEditTime: 2022-02-12 15:13:41
* @LastEditTime: 2022-02-15 09:39:33
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/components/GetPos.vue/index.vue
......@@ -14,6 +14,7 @@
width="60%"
:before-close="handleClose"
>
<template v-if="inputVisible">
<div class="search-wrapper pos">
<el-input
v-model="searchinput"
......@@ -30,7 +31,7 @@
>定位</el-button
>
</div>
</template>
<div id="getposmap"></div>
</el-dialog>
</template>
......@@ -55,10 +56,15 @@ export default {
default: "",
},
// 显示隐藏
dialogVisible:{
type:Boolean,
default:false,
}
dialogVisible: {
type: Boolean,
default: false,
},
// input跟定位按钮是否展示
inputVisible: {
type: Boolean,
default: true,
},
},
data() {
return {
......@@ -80,8 +86,7 @@ export default {
});
},
},
mounted() {
},
mounted() {},
methods: {
init() {
this.$nextTick(() => {
......@@ -90,13 +95,13 @@ export default {
if (this.device == "") {
// 如果传了路径就创建一个marker,如果没传就直接激活手动创建
if (this.devicePos.length > 0) {
this.map.addDevice({path:this.devicePos});
this.map.addDevice({ path: this.devicePos });
} else {
this.map.mouseAddMarker();
}
} else {
if (this.pipePath.length > 0) {
this.map.addPipeLine({path:this.pipePath});
this.map.addPipeLine({ path: this.pipePath });
} else {
this.mouseAddPipeline();
}
......@@ -104,7 +109,7 @@ export default {
});
},
handleClose() {
this.$emit("close")
this.$emit("close");
},
open() {
this.dialogVisible = true;
......@@ -113,7 +118,7 @@ export default {
pos() {
this.path = this.map.getPath();
this.$emit("getPath", this.path);
console.log(this.path)
console.log(this.path);
if (this.path?.length > 0) {
this.$emit("update:dialogVisible", false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment