<script setup>
import PopupLayout from "@/layouts/PopupLayout.vue";
import ctxRef from "@/utils/ctx_ref.js"
import Context from "./createDeletePopup.js"
import TInputText from "@/components/ui/TInputText.vue";
import PostForm from "@/components/form/PostForm.vue";
import SubmitButton from "@/components/form/SubmitButton.vue";
import HTTPHeaderAssistant from "@/components/server/HTTPHeaderAssistant.vue";
import CodeLabel from "@/components/common/CodeLabel.vue";
import DefinitionTable from "@/components/common/DefinitionTable.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<PopupLayout>
		<header>添加需要删除的报头</header>
		<PostForm action="$" @success="ctx.success">
			<input type="hidden" name="headerPolicyId" :value="ctx.headerPolicyId"/>
			<DefinitionTable>
				<tbody>
				<tr>
					<td class="title">报头名称<em>（Name）</em></td>
					<td>
						<TInputText type="text" name="name" maxlength="100" class="w-full" autofocus v-model="ctx.headerName"/>
						<p class="comment"><HTTPHeaderAssistant :v-type="ctx.type" :v-value="ctx.headerName" @select="ctx.selectHeader" class="my-1"></HTTPHeaderAssistant>请注意报头名称的大小写，如无特殊需求，报头名称的格式通常为<CodeLabel>Xxx</CodeLabel>或者<CodeLabel>Xxx-Yyy</CodeLabel>。</p>
					</td>
				</tr>
				</tbody>
			</DefinitionTable>
			<SubmitButton></SubmitButton>
		</PostForm>

	</PopupLayout>
</template>

<style lang="postcss" scoped>
</style>