shuishen
2023-03-29 5ab15852cea6332f55f7a0f0366b66e24119d30d
src/components/mapSearchBox/index.vue
@@ -5,7 +5,7 @@
            <div class="clear" v-show="isShowClearBtn" @click="clearSearchValue" title="清空">
                <img src="/img/icon/clear.png" alt />
            </div>
            <button @click="searchExtensivelyClick" class="el-icon-search"></button>
            <!-- <button @click="searchExtensivelyClick" class="el-icon-search"></button> -->
        </div>
        <div v-show="searchExtensivelyValBoxShow" class="searchExtensively-val-box">
            <div>
@@ -28,16 +28,14 @@
            isShowClearBtn: false,
            searchExtensivelyValBoxShow: false,
            searchExtensivelyArray: [],
            isClickValBox: false,
        }
    },
    watch: {
        searchExtensivelyValue: {
            handler (newText, oldText) {
                this.$EventBus.$emit('mapClearLayer', {
                    layerName: 'searchLayer',
                    type: 'VectorLayer'
                })
                if (newText == '') {
                    this.searchExtensivelyValBoxShow = false
@@ -45,6 +43,16 @@
                    this.searchExtensivelyArray = []
                } else {
                    this.searchExtensivelyValBoxShow = true
                    if (this.isClickValBox) {
                        this.searchExtensivelyValBoxShow = false
                        this.isClickValBox = false
                    } else {
                        this.$EventBus.$emit('mapClearLayer', {
                            layerName: 'searchLayer',
                            type: 'VectorLayer'
                        })
                    }
                    this.isShowClearBtn = true
                    this.getSearchExtensively('ebf48ecaa1fd436fa3d40c4600aa051f', '361100', this.searchExtensivelyValue)
                }
@@ -79,7 +87,7 @@
                        lng: `${this.searchExtensivelyArray[0].location.lng}`,
                        lat: `${this.searchExtensivelyArray[0].location.lat}`,
                        alt: 1,
                        text: this.searchExtensivelyArray[0].name
                        text: this.searchExtensivelyArray[0].name,
                    },
                })
            }
@@ -109,11 +117,13 @@
        searchExtensivelyVlaClick (item) {
            this.searchExtensivelyValBoxShow = false
            this.isClickValBox = true
            this.searchExtensivelyValue = item.name
            this.$EventBus.$emit('toPosition', {
                siteJd: `${item.location.lng}`,
                siteWd: `${item.location.lat}`,
                siteGd: 200,
                siteGd: 1000,
            })
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'searchLayer',
@@ -126,7 +136,8 @@
                    lng: `${item.location.lng}`,
                    lat: `${item.location.lat}`,
                    alt: 1,
                    text: item.name
                    text: item.name,
                    fontColor: global.DC.Color.ORANGE,
                }
            })
            this.$EventBus.$emit('layerPointAdd', {
@@ -163,14 +174,14 @@
    input {
        flex: 1;
        width: 400px;
        width: 440px;
        height: 100%;
        font-size: 18px;
        text-indent: 1em;
        color: #ffffff;
        background-color: rgba(24, 79, 202, 0.75);
        border: 1px solid rgb(0, 92, 169);
        border-radius: 20px 0 0 20px;
        border-radius: 20px;
        vertical-align: top;
    }