diff --git a/admin/templates/js/bmaps.js b/admin/templates/js/bmaps.js index d55e7bb..e742bde 100644 --- a/admin/templates/js/bmaps.js +++ b/admin/templates/js/bmaps.js @@ -377,10 +377,7 @@ var APPMAP; _this.watch(_this, 'selectProv', function () { _this.filter(); }); - _this.watch(_this, 'selectCity', function () { - _this.filter(); - }); - _this.watch(_this, 'selectDist', function () { + _this.watch(_this, 'allCity', function () { _this.filter(); }); $('#selectMapId').on('shown.bs.modal', function () { @@ -644,8 +641,11 @@ var APPMAP; inputVid.trigger('change'); }; selectMap.prototype.filter = function () { - var vtype = $('select[name="vtype"]').val(); - vtype = vtype ? vtype.join(',') : ''; + var vtype; + if ($('select[name="vtype"]').length) { + vtype = $('select[name="vtype"]').val(); + vtype = vtype ? vtype.join(',') : ''; + } $('#selectMapId .mapreset').trigger('click'); this.selectMap.clearOverlays(); this.ajaxlnglatList(this.selectMap, { diff --git a/src/admin/templates/js/bmaps.ts b/src/admin/templates/js/bmaps.ts index 6492adc..5bae303 100644 --- a/src/admin/templates/js/bmaps.ts +++ b/src/admin/templates/js/bmaps.ts @@ -533,10 +533,7 @@ namespace APPMAP { this.watch(this, 'selectProv', () => { this.filter() }) - this.watch(this, 'selectCity', () => { - this.filter() - }) - this.watch(this, 'selectDist', () => { + this.watch(this, 'allCity', () => { this.filter() }) @@ -904,8 +901,11 @@ namespace APPMAP { // 根据条件筛选小区 filter() { // 获取指定的值 - let vtype = $('select[name="vtype"]').val() - vtype = vtype ? vtype.join(',') : '' + let vtype:any + if($('select[name="vtype"]').length){ + vtype = $('select[name="vtype"]').val() + vtype = vtype ? vtype.join(',') : '' + } // 需要将缓存全部删除掉 $('#selectMapId .mapreset').trigger('click') //清除标注