<script setup>
// Copyright 2024 FlexCDN root@flexcdn.cn. All rights reserved. Official site: https://flexcdn.cn .

import PopupLayout from "@/layouts/PopupLayout.vue";
import ctxRef from "@/utils/ctx_ref.js"
import Context from "./createLogPopup.js"
import TTextarea from "@/components/ui/TTextarea.vue";
import TSelect from "@/components/ui/TSelect.vue";
import TOption from "@/components/ui/TOption.vue";
import SubmitButton from "@/components/form/SubmitButton.vue";
import PostForm from "@/components/form/PostForm.vue";
import DefinitionTable from "@/components/common/DefinitionTable.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<PopupLayout>
		<header>工单回复</header>

		<PostForm @success="ctx.success" action="$">
			<input type="hidden" name="ticketId" :value="ctx.ticketId"/>

			<DefinitionTable>
				<tbody>
				<tr>
					<td class="title">回复内容</td>
					<td>
						<TTextarea rows="6" name="comment" autofocus class="w-full"></TTextarea>
					</td>
				</tr>
				<tr>
					<td>状态</td>
					<td>
						<TSelect name="status">
							<TOption value="">[状态]</TOption>
							<TOption v-for="status in ctx.statusList" :value="status.code">{{status.name}}</TOption>
						</TSelect>
					</td>
				</tr>
				</tbody>
			</DefinitionTable>

			<SubmitButton></SubmitButton>
		</PostForm>
	</PopupLayout>
</template>

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