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