import { _ as B } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { B as C } from "./BasicForm-dL_oCSPM.js";
import { u as j } from "./useForm-CKmgcynv.js";
import { V as r, d as q, f as v, e as F, c as I, o as V, l as s, w as A, j as O, cZ as P, __tla as __tla_0 } from "./index-9PRMimni.js";
import { A as S } from "./template-rpthWlT9.js";
import { v as G, __tla as __tla_1 } from "./schemas-DLHXnB0l.js";
import { u as N } from "./useModal-CO65vga3.js";
let K;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: n } = r();
    function z() {
        return {
            schemas: [
                {
                    field: "comment",
                    component: "NInput",
                    giProps: {
                        span: 2
                    },
                    label: n("hsqe.planner.modal.reason"),
                    componentProps: {
                        type: "textarea",
                        maxlength: 300,
                        showCount: !0
                    },
                    rules: [
                        {
                            required: !0,
                            message: n("hsqe.planner.modal.reasonHint"),
                            trigger: [
                                "input",
                                "blur"
                            ]
                        }
                    ]
                }
            ]
        };
    }
    K = q({
        __name: "rejectModal",
        emits: [
            "success"
        ],
        setup (c, { expose: m, emit: i }) {
            const u = i, l = P(), p = v(), d = F(), { t: e } = r(), { schemas: f } = z(), { templateCode: g, isTankerFunc: h } = G(), [_, { openModal: x, closeModal: R, setSubLoading: o }] = N({
                title: e("common.addText"),
                subBtuText: e("common.okText"),
                cancelText: e("common.cancelText"),
                width: 650
            }), [b, { submit: w, getFieldsValue: M }] = j({
                schemas: f,
                labelWidth: "auto",
                layout: "horizontal",
                gridProps: {
                    cols: 2,
                    xGap: 15
                },
                showActionButtonGroup: !1
            });
            async function T() {
                x();
            }
            async function k() {
                if (!await w()) return o(!1), !1;
                const t = M();
                try {
                    await S({
                        busId: p.query.uuid,
                        moduleCode: h() ? g : "vesselInspect",
                        ...t
                    }), l.success(e("common.submitRejectText")), d.go(-2), R(), o(!1), u("success");
                } catch  {
                    o(!1);
                }
            }
            return m({
                showModal: T
            }), (y, t)=>{
                const a = B;
                return V(), I(a, {
                    ref: "modalRef",
                    onRegister: s(_),
                    onOnOk: k
                }, {
                    default: A(()=>[
                            O(s(C), {
                                onRegister: s(b),
                                "label-placement": "top"
                            }, null, 8, [
                                "onRegister"
                            ])
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { K as _, __tla };
