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

更改组件

parent 794299a3
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-02-12 11:07:10 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/components/GetPos.vue/index.vue * @FilePath: /test/hello-world/src/components/GetPos.vue/index.vue
...@@ -14,23 +14,24 @@ ...@@ -14,23 +14,24 @@
width="60%" width="60%"
:before-close="handleClose" :before-close="handleClose"
> >
<div class="search-wrapper pos"> <template v-if="inputVisible">
<el-input <div class="search-wrapper pos">
v-model="searchinput" <el-input
class="searchinput" v-model="searchinput"
placeholder="请输入内容" class="searchinput"
size="mini" placeholder="请输入内容"
style="width: 150px" size="mini"
ref="input" style="width: 150px"
></el-input> ref="input"
</div> ></el-input>
</div>
<div @click="pos" class="positionBtn pos">
<el-button type="primary" size="mini" icon="el-icon-position"
>定位</el-button
>
</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> <div id="getposmap"></div>
</el-dialog> </el-dialog>
</template> </template>
...@@ -55,10 +56,15 @@ export default { ...@@ -55,10 +56,15 @@ export default {
default: "", default: "",
}, },
// 显示隐藏 // 显示隐藏
dialogVisible:{ dialogVisible: {
type:Boolean, type: Boolean,
default:false, default: false,
} },
// input跟定位按钮是否展示
inputVisible: {
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
...@@ -80,8 +86,7 @@ export default { ...@@ -80,8 +86,7 @@ export default {
}); });
}, },
}, },
mounted() { mounted() {},
},
methods: { methods: {
init() { init() {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -90,13 +95,13 @@ export default { ...@@ -90,13 +95,13 @@ export default {
if (this.device == "") { if (this.device == "") {
// 如果传了路径就创建一个marker,如果没传就直接激活手动创建 // 如果传了路径就创建一个marker,如果没传就直接激活手动创建
if (this.devicePos.length > 0) { if (this.devicePos.length > 0) {
this.map.addDevice({path:this.devicePos}); this.map.addDevice({ path: this.devicePos });
} else { } else {
this.map.mouseAddMarker(); this.map.mouseAddMarker();
} }
} else { } else {
if (this.pipePath.length > 0) { if (this.pipePath.length > 0) {
this.map.addPipeLine({path:this.pipePath}); this.map.addPipeLine({ path: this.pipePath });
} else { } else {
this.mouseAddPipeline(); this.mouseAddPipeline();
} }
...@@ -104,7 +109,7 @@ export default { ...@@ -104,7 +109,7 @@ export default {
}); });
}, },
handleClose() { handleClose() {
this.$emit("close") this.$emit("close");
}, },
open() { open() {
this.dialogVisible = true; this.dialogVisible = true;
...@@ -113,7 +118,7 @@ export default { ...@@ -113,7 +118,7 @@ export default {
pos() { pos() {
this.path = this.map.getPath(); this.path = this.map.getPath();
this.$emit("getPath", this.path); this.$emit("getPath", this.path);
console.log(this.path) console.log(this.path);
if (this.path?.length > 0) { if (this.path?.length > 0) {
this.$emit("update:dialogVisible", false); 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