From 0e088ce9325c17cab7b6b62fae6c1880666890a7 Mon Sep 17 00:00:00 2001 From: cloud Date: Wed, 30 Dec 2020 20:40:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9bmaps.js=E9=87=8D=E6=96=B0=E7=BC=96?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/templates/js/bmaps.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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(); } }