From 9e3dc3d2d2cbdd9fe58e7e3d17c59062be5aba5b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 4 Dec 2020 09:51:18 +0800 Subject: [PATCH] =?UTF-8?q?[WAF]=E7=9C=81=E4=BB=BD=E5=B0=81=E7=A6=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../servers/components/waf/ipadmin/index.html | 1 + .../servers/components/waf/ipadmin/index.js | 12 ++++++++++++ .../components/waf/ipadmin/provinces.html | 12 +++++++++++- .../servers/components/waf/ipadmin/provinces.js | 17 ++++++++++++++++- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/web/views/@default/servers/components/waf/ipadmin/index.html b/web/views/@default/servers/components/waf/ipadmin/index.html index c741a13c..232040fd 100644 --- a/web/views/@default/servers/components/waf/ipadmin/index.html +++ b/web/views/@default/servers/components/waf/ipadmin/index.html @@ -9,6 +9,7 @@ 已封禁 + 暂时没有选择封禁区域。
({{country.letter}}){{country.name}} diff --git a/web/views/@default/servers/components/waf/ipadmin/index.js b/web/views/@default/servers/components/waf/ipadmin/index.js index 7de05ca7..450fcf99 100644 --- a/web/views/@default/servers/components/waf/ipadmin/index.js +++ b/web/views/@default/servers/components/waf/ipadmin/index.js @@ -5,6 +5,9 @@ Tea.context(function () { this.selectedGroup = "ABC" this.letterCountries = {} let that = this + this.countSelectedCountries = this.countries.$count(function (k, country) { + return country.isChecked + }) this.countries.forEach(function (country) { if (typeof (that.letterCountries[country.letter]) == "undefined") { that.letterCountries[country.letter] = [] @@ -19,10 +22,12 @@ Tea.context(function () { this.selectCountry = function (country) { country.isChecked = !country.isChecked + this.change() } this.deselectCountry = function (country) { country.isChecked = false + this.change() } this.checkAll = function () { @@ -31,6 +36,8 @@ Tea.context(function () { this.countries.forEach(function (country) { country.isChecked = that.isCheckingAll }) + + this.change() } this.success = function () { @@ -39,6 +46,11 @@ Tea.context(function () { }) } + this.change = function () { + this.countSelectedCountries = this.countries.$count(function (k, country) { + return country.isChecked + }) + } /** * 添加IP名单菜单 diff --git a/web/views/@default/servers/components/waf/ipadmin/provinces.html b/web/views/@default/servers/components/waf/ipadmin/provinces.html index 92cf6a9b..ca240b3f 100644 --- a/web/views/@default/servers/components/waf/ipadmin/provinces.html +++ b/web/views/@default/servers/components/waf/ipadmin/provinces.html @@ -9,6 +9,7 @@ 已封禁 + 暂时没有选择封禁省份。
{{province.name}} @@ -18,7 +19,16 @@ 选择封禁区域 - 选择省份/自治区 + + + 选择省份/自治区 +
+
+ + +
+
+
diff --git a/web/views/@default/servers/components/waf/ipadmin/provinces.js b/web/views/@default/servers/components/waf/ipadmin/provinces.js index 9c36ef57..31eff506 100644 --- a/web/views/@default/servers/components/waf/ipadmin/provinces.js +++ b/web/views/@default/servers/components/waf/ipadmin/provinces.js @@ -1,20 +1,28 @@ Tea.context(function () { this.isCheckingAll = false + this.countSelectedProvinces = this.provinces.$count(function (k, province) { + return province.isChecked + }) + this.selectProvince = function (province) { province.isChecked = !province.isChecked + this.change() } this.deselectProvince = function (province) { province.isChecked = false + this.change() } this.checkAll = function () { this.isCheckingAll = !this.isCheckingAll - + let that = this this.provinces.forEach(function (province) { province.isChecked = that.isCheckingAll }) + + this.change() } this.success = function () { @@ -23,6 +31,13 @@ Tea.context(function () { }) } + + this.change = function () { + this.countSelectedProvinces = this.provinces.$count(function (k, province) { + return province.isChecked + }) + } + /** * 添加IP名单菜单 */