Vue.component("http-request-conds-box", { props: ["v-conds"], data: function () { let conds = this.vConds if (conds == null) { conds = { isOn: true, connector: "or", groups: [] } } return { conds: conds, components: window.REQUEST_COND_COMPONENTS } }, methods: { addGroup: function () { let that = this teaweb.popup("/servers/server/settings/conds/addGroupPopup", { height: "30em", callback: function (resp) { that.conds.groups.push(resp.data.group) } }) }, updateGroup: function (groupIndex, group) { window.UPDATING_COND_GROUP = group let that = this teaweb.popup("/servers/server/settings/conds/addGroupPopup", { height: "30em", callback: function (resp) { Vue.set(that.conds.groups, groupIndex, resp.data.group) } }) }, removeGroup: function (groupIndex) { let that = this teaweb.confirm("确定要删除这一组条件吗?", function () { that.conds.groups.$remove(groupIndex) }) }, typeName: function (cond) { let c = this.components.$find(function (k, v) { return v.type == cond.type }) if (c != null) { return c.name; } return cond.param + " " + cond.operator } }, template: `
` })