Vue.component("http-firewall-province-selector", { props: ["v-type", "v-provinces"], data: function () { let provinces = this.vProvinces if (provinces == null) { provinces = [] } return { listType: this.vType, provinces: provinces } }, methods: { addProvince: function () { let selectedProvinceIds = this.provinces.map(function (province) { return province.id }) let that = this teaweb.popup("/servers/server/settings/waf/ipadmin/selectProvincesPopup?type=" + this.listType + "&selectedProvinceIds=" + selectedProvinceIds.join(","), { width: "50em", height: "26em", callback: function (resp) { that.provinces = resp.data.selectedProvinces that.$forceUpdate() that.notifyChange() } }) }, removeProvince: function (index) { this.provinces.$remove(index) this.notifyChange() }, resetProvinces: function () { this.provinces = [] this.notifyChange() }, notifyChange: function () { this.$emit("change", { "provinces": this.provinces }) } }, template: `
` })