diff --git a/admin/templates/js/bmaps.js b/admin/templates/js/bmaps.js index edcfce4..18e1b53 100644 --- a/admin/templates/js/bmaps.js +++ b/admin/templates/js/bmaps.js @@ -371,6 +371,18 @@ var APPMAP; }; _this.villageFilterList = {}; _this.villageList = {}; + $(document).on('change', 'select[name="vtype"]', function () { + _this.filter(); + }); + _this.watch(_this, 'selectProv', function () { + _this.filter(); + }); + _this.watch(_this, 'selectCity', function () { + _this.filter(); + }); + _this.watch(_this, 'selectDist', function () { + _this.filter(); + }); $('#selectMapId').on('shown.bs.modal', function () { if (_this.selectMapInitType) return false; @@ -631,6 +643,20 @@ var APPMAP; inputVid.val(keysStr); inputVid.trigger('change'); }; + selectMap.prototype.filter = function () { + var vtype = $('select[name="vtype"]').val(); + vtype = vtype ? vtype.join(',') : ''; + $('#selectMapId .mapreset').trigger('click'); + this.selectMap.clearOverlays(); + this.ajaxlnglatList(this.selectMap, { + id: '', + province: this.selectProv, + city: this.selectCity, + district: this.selectDist, + vtype: vtype, + allinfo: 'all' + }, true); + }; return selectMap; }(initialMap)); function bmaps() { @@ -643,7 +669,6 @@ var APPMAP; new showMap(); } else if ($('#selectMap').length) { - console.log('-------------'); new selectMap(); } }