Commit c061a277 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 20dce006 c692296b
<!--
* @Author: your name
* @Date: 2022-02-12 11:07:10
* @LastEditTime: 2022-02-12 15:13:41
* @LastEditTime: 2022-02-15 10:33:20
* @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,32 +14,33 @@
width="60%"
:before-close="handleClose"
>
<div class="search-wrapper pos">
<el-input
v-model="searchinput"
class="searchinput"
placeholder="请输入内容"
size="mini"
style="width: 150px"
ref="input"
></el-input>
</div>
<div @click="pos" class="positionBtn pos">
<el-button type="primary" size="mini" icon="el-icon-position"
>定位</el-button
>
</div>
<template v-if="inputVisible">
<div class="search-wrapper pos">
<el-input
v-model="searchinput"
class="searchinput"
placeholder="请输入内容"
size="mini"
style="width: 150px"
ref="input"
></el-input>
</div>
<div @click="pos" class="positionBtn pos">
<el-button type="primary" size="mini" icon="el-icon-position"
>定位</el-button
>
</div>
</template>
<div id="getposmap"></div>
</el-dialog>
</template>
<script>
import { EditorMap } from "./untils/getPath.js";
import { EditorMap } from "@/utils/mapClass/getPath.js";
export default {
props: {
//管道路径,二维数组
//管道路径,二维数组s
pipePath: {
type: Array,
default: () => [],
......@@ -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