|
@@ -8,7 +8,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import permissionComponent from './permissionComponent';
|
|
|
export default {
|
|
|
+ mixins: [permissionComponent],
|
|
|
data() {
|
|
|
return {
|
|
|
map: '',
|
|
@@ -19,11 +21,35 @@ export default {
|
|
|
polygons: [],
|
|
|
addressName: '', //地址查询名称
|
|
|
poisArray: [],
|
|
|
- loadding: true
|
|
|
+ loadding: true,
|
|
|
+ mixins_query: {
|
|
|
+ communityId: ''
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
mounted() {},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ poisArrays() {
|
|
|
+ let arrs = [];
|
|
|
+ this.poisArray.map((item) => {
|
|
|
+ if (!!this.mixins_query.communityId) {
|
|
|
+ if (item.id == this.mixins_query.communityId) {
|
|
|
+ arrs = [item];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ arrs = this.poisArray;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return arrs;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ //全局社区接口调用
|
|
|
+ 'mixins_query.communityId'(val) {
|
|
|
+ this.map.clearMap();
|
|
|
+ this.mapMak();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
init() {
|
|
|
this.map = new AMap.Map('mapInit', {
|
|
@@ -45,8 +71,8 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
mapMak() {
|
|
|
- if (this.poisArray.length > 0) {
|
|
|
- this.poisArray.map((item) => {
|
|
|
+ if (this.poisArrays.length > 0) {
|
|
|
+ this.poisArrays.map((item) => {
|
|
|
this.addIcon(item);
|
|
|
});
|
|
|
}
|