import { n as e } from "./chunk-TYymryXo.mjs";
import { n as t, t as n } from "./enum-CS9IY_0V.mjs";
import { n as r } from "./utils-Dl74Cgor.mjs";
import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, openBlock as d, renderList as f, unref as p, withCtx as m } from "vue";
import { Button as h, Form as g, FormItem as _, Input as v, Select as y } from "ant-design-vue/es";
import { DeleteOutlined as b, PlusOutlined as x } from "@ant-design/icons-vue";
//#region src/pages/flow-create/flow-model/createComponents/step4/components/HttpRequestBodySetting.vue?vue&type=script&setup=true&lang.ts
var S = /* @__PURE__ */ u({
	name: "HttpRequestBodySetting",
	__name: "HttpRequestBodySetting",
	props: {
		body: {
			type: Array,
			required: !1,
			default: () => []
		},
		bind: {
			type: String,
			required: !0
		}
	},
	setup(e) {
		let u = e, S = r();
		function C(e) {
			e.value = "";
		}
		function w(e) {
			e.push({
				key: "",
				type: t.FIXED_VALUE,
				value: ""
			});
		}
		function T(e, t) {
			e.splice(t, 1);
		}
		return (e, r) => {
			let E = v, D = _, O = y, k = b, A = g, j = x, M = h;
			return d(), s("div", null, [(d(!0), s(i, null, f(u.body, (e, r) => (d(), a(A, {
				key: r,
				model: e,
				layout: "inline",
				class: "mb-4px!"
			}, {
				default: m(() => [
					l(D, { name: "key" }, {
						default: m(() => [l(E, {
							value: e.key,
							"onUpdate:value": (t) => e.key = t,
							style: { width: "160px" }
						}, null, 8, ["value", "onUpdate:value"])]),
						_: 2
					}, 1024),
					l(D, { name: "type" }, {
						default: m(() => [l(O, {
							value: e.type,
							"onUpdate:value": (t) => e.type = t,
							style: { width: "160px" },
							options: p(n),
							onChange: (t) => C(e)
						}, null, 8, [
							"value",
							"onUpdate:value",
							"options",
							"onChange"
						])]),
						_: 2
					}, 1024),
					e.type === p(t).FIXED_VALUE ? (d(), a(D, {
						key: 0,
						name: "value"
					}, {
						default: m(() => [l(E, {
							value: e.value,
							"onUpdate:value": (t) => e.value = t,
							style: { width: "200px" }
						}, null, 8, ["value", "onUpdate:value"])]),
						_: 2
					}, 1024)) : o("", !0),
					e.type === p(t).FROM_FORM ? (d(), a(D, {
						key: 1,
						name: "value"
					}, {
						default: m(() => [l(O, {
							value: e.value,
							"onUpdate:value": (t) => e.value = t,
							options: p(S),
							style: { width: "200px" },
							"field-names": {
								label: "title",
								value: "field"
							}
						}, null, 8, [
							"value",
							"onUpdate:value",
							"options"
						])]),
						_: 2
					}, 1024)) : o("", !0),
					l(D, null, {
						default: m(() => [l(k, {
							style: { fontSize: "18px" },
							onClick: (e) => T(u.body, r)
						}, null, 8, ["onClick"])]),
						_: 2
					}, 1024)
				]),
				_: 2
			}, 1032, ["model"]))), 128)), l(M, {
				type: "link",
				onClick: r[0] ||= (e) => w(u.body)
			}, {
				default: m(() => [l(j, { class: "mr-5px" }), r[1] ||= c("添加一行 ", -1)]),
				_: 1
			})]);
		};
	}
}), C = /* @__PURE__ */ e({ default: () => w }), w = S;
//#endregion
export { C as n, w as t };
