suerprisePlus
2024-07-30 e5e65bb50cbfb973f98191993ab559767eff7a53
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<template>
    <Popup ref="pop" top="20px" :title="title" @close="close(true)" width="1000px" :maxHeight="'700px'"
        @cancel="close(false)">
        <div class="menuBox">
            <div class="serachContent">
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item label="名称">
                        <el-input size="small" v-model="formInline.name" placeholder="请输入定位名称..."></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button size="small" plain type="primary" @click="setInfoSearch"
                            icon="el-icon-search">查询</el-button>
                    </el-form-item>
                    <el-form-item>
                        <el-button size="small" plain type="info" @click="setInfoRefresh"
                            icon="el-icon-refresh">重置</el-button>
                    </el-form-item>
                </el-form>
            </div>
            <div class="tableContent">
                <div class="tableBox">
                    <el-table :data="tableData" border height="calc(100% - 2px)" ref="filterTable" style="width: 100%">
                        <el-table-column label="定位" width="100" align="center">
                            <template slot-scope="scope">
                                <el-button icon="el-icon-map-location" size="small"
                                    @click="spaceLocation(scope.$index, scope.row)"></el-button>
                            </template>
                        </el-table-column>
                        <el-table-column label="名称" prop="name" align="center"></el-table-column>
                        <el-table-column label="环线" prop="line" align="center"></el-table-column>
                        <el-table-column label="类型" prop="type" align="center"></el-table-column>
                        <el-table-column label="位置" prop="geom" align="center"></el-table-column>
                    </el-table>
                </div>
 
                <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
                    :limit.sync="queryParams.pageSize" @pagination="getAttributeInfo" />
            </div>
        </div>
    </Popup>
</template>
 
<script>
import Popup from '@/components/Tool/Popup.vue';
import { zhangzitou_selectAll } from "@/api/mapView/map.js"
import mapConfig from '../../../assets/js/mapSdk/mapConfig';
 
 
export default {
    name: 'attributeInfo',
    components: { Popup },
    data() {
        return {
            title: '属性信息',
            total: 0,
            queryParams: {
                pageIndex: 1,
                pageSize: 10,
                name: "",
                srid: 4326,
            },
            billboardEntity: null,
            formInline: {
                name: ''
            }
        };
    },
    methods: {
        // 关闭弹窗
        close(isCloseBtn, removeLayer = true) {
            //   removeLayer && this.removeImageLayer();
            this.delBillboard();
            // 重置data值
            Object.assign(this.$data, this.$options.data());
            !isCloseBtn && this.$refs.pop.close();
        },
 
        // 打开弹窗
        open() {
            this.close(true);
            this.$refs.pop.open();
            this.getAttributeInfo();
        },
        setInfoSearch() {
            this.queryParams.name = this.formInline.name;
            this.getAttributeInfo();
        },
        setInfoRefresh() {
            this.formInline.name = "";
            this.queryParams.pageIndex = 1;
            this.queryParams.pageSize = 10;
            this.setInfoSearch();
        },
        getAttributeInfo() {
            zhangzitou_selectAll({
                name: this.queryParams.name,
                page: this.queryParams.pageIndex,
                limit: this.queryParams.pageSize,
                srid: this.queryParams.srid
            }).then(response => {
                if (response.data.code != 200) return;
                const valDta = response.data.result;
                this.total = valDta.total;
                this.tableData = valDta.pois
            })
        },
        delBillboard() {
            if (this.billboardEntity) {
                this.billboardEntity.removeFromMap();
                this.billboardEntity = null;
                return
            }
        },
        spaceLocation(index, row) {
            var wkt = mapConfig.getWKTParse(row.geom);
            this.delBillboard();
            const url = config.sdkImg + 'Workers/image/mark.png';
            this.billboardEntity = earthCtrl.factory.createBillboard({
                name: "标签点",
                image: url,
                width: 16,
                height: 22,
                lon: wkt.coordinates[0],
                lat: wkt.coordinates[1],
                alt: 10,
                scale: 1.5,
            });
            earthCtrl.userScene.flyTo(this.billboardEntity)
 
        },
 
 
 
 
 
    },
};
</script>
 
<style lang="scss" scoped>
.menuBox {
    position: relative;
    height: 660px;
    width: calc(100% - 0px);
    padding: 10px;
    display: flex;
    flex-direction: column;
 
    .serachContent {
        display: flex;
    }
 
    .tableContent {
        flex: 1;
        display: flex;
        flex-direction: column;
        background: #ffffff;
 
        .tableBox {
            flex: 1;
 
        }
 
        .pagination-container {
            padding: 0px 10px !important;
        }
 
    }
 
}
</style>