const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShipOverview-BGDdXUrO.js","assets/index-9PRMimni.js","assets/index-CZ_CrH4_.css","assets/BasicForm-dL_oCSPM.js","assets/Render.vue_vue_type_script_lang-DKUYY0Zw.js","assets/SingleImageUpload-CNx4b9eC.js","assets/ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js","assets/componentSetting-DVhNDBTO.js","assets/ImageUpload-2O79x_Q-.css","assets/ImageUpload-DUsnro3W.js","assets/vuedraggable.umd-Co2xEC3p.js","assets/BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js","assets/BasicUpload-q2aOClOy.css","assets/tabsView-BXskTdVh.js","assets/BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js","assets/propTypes-CebMRUpe.js","assets/BasicForm-foIylFd_.css","assets/BasicSelect-C_uwzMkE.js","assets/BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js","assets/BasicSelect-DteQK1Vf.css","assets/dictionary-BRse4lkf.js","assets/index-DkvzUEqh.js","assets/index-kKnqLkWM.js","assets/AutoComplete-Dv1Bqed4.js","assets/TreeSelect-BZh2DeCh.js","assets/schemas-C0ECnkWr.js","assets/template-rpthWlT9.js","assets/planner-BebmniHR.js","assets/useForm-CKmgcynv.js","assets/usePageCache-DluHn7Yy.js","assets/ScoreForm-CyVFGh4s.js","assets/Table-0PViRYCf.js","assets/Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js","assets/componentMap-CElCaWis.js","assets/format-DgF6KtHk.js","assets/omit-B2_8Y6O_.js","assets/_flatRest-DBrd2CHT.js","assets/flatten-DeoUZLdb.js","assets/Table-Dcnz4X4a.css","assets/print-CT_2hrjP.js","assets/basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js","assets/basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js","assets/basicModal-DbyYhys_.css","assets/useModal-CO65vga3.js","assets/useTimeout-BxFilWvD.js","assets/Flex-CTSf12gq.js","assets/columns-CSOIGjyz.js","assets/dateUtil-BtafrT1f.js","assets/RectificationProject-Ck2VVVsz.js","assets/RectificationModal.vue_vue_type_script_setup_true_lang-fAwMd5lQ.js","assets/TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js","assets/GoodPracticesDiscovered-CUySO0CZ.js","assets/ShipTotalScoreAndRating-DwSnPhh9.js","assets/ShipReferencePhotos-p-gZ5EHc.js"])))=>i.map(i=>d[i]);
import { d as te, bk as oe, V as ae, r as l, a4 as y, ec as c, a as ne, c as P, o as h, X as se, w as u, j as p, h as x, D, l as t, ds as R, ca as le, gE as re, H as ie, i as ce, A as ue, W as pe, br as m, ac as C, cO as me, gJ as de, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as _e } from "./BasicForm-dL_oCSPM.js";
import { _ as fe } from "./TableSelect.vue_vue_type_script_setup_true_lang-BAU5mgvB.js";
import { T as ve } from "./tabsView-BuQA2jOW.js";
import { c as he, g as be, __tla as __tla_1 } from "./schemas-C0ECnkWr.js";
import { g as Te } from "./planner-BebmniHR.js";
import { s as ge } from "./template-rpthWlT9.js";
import { f as ye } from "./hook-C9rOLWu_.js";
import { u as Pe } from "./useForm-CKmgcynv.js";
let Ae;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let De, Re;
    De = {
        key: 0
    };
    Re = {
        key: 1
    };
    Ae = te({
        __name: "FormPage",
        emits: [
            "handleBack"
        ],
        setup (Se, { expose: I, emit: B }) {
            const O = B, A = oe(), { t: n } = ae(), S = {
                ShipOverview: c(()=>m(()=>import("./ShipOverview-BGDdXUrO.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),
                ScoreForm: c(()=>m(()=>import("./ScoreForm-CyVFGh4s.js"), __vite__mapDeps([30,1,2,31,32,10,4,33,15,34,35,36,37,38,39,40,41,42,43,7,44,29,13,45,46,47]))),
                RectificationProject: c(()=>m(()=>import("./RectificationProject-Ck2VVVsz.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([48,1,2,49,40,41,42,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,43,28,29,31,32,33,34,35,36,37,38,39,44,45,50,46,47]))),
                GoodPracticesDiscovered: c(()=>m(()=>import("./GoodPracticesDiscovered-CUySO0CZ.js"), __vite__mapDeps([51,1,2,31,32,10,4,33,15,34,35,36,37,38,39,40,41,42,43,7,44,29,13,45]))),
                ShipTotalScoreAndRating: c(()=>m(()=>import("./ShipTotalScoreAndRating-DwSnPhh9.js"), __vite__mapDeps([52,1,2,46,47,34]))),
                ShipReferencePhotos: c(()=>m(()=>import("./ShipReferencePhotos-p-gZ5EHc.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([53,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29])))
            }, d = l(), r = l("first"), _ = l(), k = l(""), a = l({}), T = l([]), b = l({}), F = {
                gridProps: {
                    cols: "2"
                },
                labelWidth: 80,
                submitButtonText: n("common.searchText"),
                showAdvancedButton: !1,
                schemas: [
                    {
                        field: "namePrefix",
                        component: "NInput",
                        label: n("hsqe.planner.modal.planPort")
                    }
                ]
            }, L = [
                {
                    title: n("hsqe.planner.modal.port"),
                    key: "port"
                },
                {
                    title: n("hsqe.planner.modal.country"),
                    key: "country"
                }
            ], N = y(()=>S[d.value] || S.ScoreForm), q = y(()=>+a.value?.approveStatus != 3 && k.value !== "view"), E = y(()=>_.value || _.value === 0), { templateCode: U, getTabListFunc: V } = be(), { reportFormSchemas: W, prevailingConditionsOptions: G } = he({
                readonly: E
            }), f = ne({
                tabsList: V(),
                activeKey: "ShipOverview"
            }), [$, { setFieldsValue: g }] = Pe({
                gridProps: {
                    cols: 5
                },
                layout: "horizontal",
                labelWidth: "auto",
                schemas: W,
                showActionButtonGroup: !1
            });
            function j(o) {
                return Te({
                    ...o,
                    ...t(b)
                });
            }
            function K(o) {
                d.value = o.value;
            }
            async function M() {
                try {
                    a.value = await ge({
                        templateCode: U,
                        uuid: _.value
                    });
                    const o = a.value?.checkTeb || {};
                    T.value = [];
                    for(const e in o)T.value.push({
                        label: o[e]?.[0]?.[A.getLocale === "en" ? "inspectionTypeEn" : "inspectionTypeZh"],
                        value: e
                    });
                    f.tabsList = V(T.value);
                    for(const e in o)for (const i of o[e] || [])i.inspectionResult && (i.inspectionResult = Number(i.inspectionResult));
                    a.value.prevailingConditions = [], G.forEach((e)=>{
                        a.value[e.value] && a.value.prevailingConditions.push(e.value);
                    });
                } catch (o) {
                    console.error(o), a.value = {};
                }
            }
            async function z(o, e) {
                _.value = e?.uuid, k.value = o, _.value ? (await M(), await C(), g(a.value)) : g({
                    reportBy: me.get(de, ""),
                    reportDate: ye(new Date)
                });
            }
            function H(o) {
                o ? (r.value = "first", C(()=>{
                    g(a.value);
                })) : O("handleBack");
            }
            async function J() {
                r.value = "second", d.value = f.tabsList[0]?.value;
            }
            return I({
                handleOpen: z
            }), (o, e)=>{
                const i = re, X = ie, Z = fe, Q = _e, Y = pe, ee = se;
                return h(), P(ee, null, {
                    default: u(()=>[
                            p(Y, {
                                bordered: !1,
                                segmented: {
                                    content: !0
                                },
                                class: "ui-card"
                            }, {
                                header: u(()=>[
                                        p(X, {
                                            align: "center"
                                        }, {
                                            default: u(()=>[
                                                    p(i, {
                                                        tooltip: t(n)("common.backText"),
                                                        iconName: "back",
                                                        iconType: "lineIcon",
                                                        class: "cursor-pointer",
                                                        onClick: e[0] || (e[0] = (s)=>H(t(r) === "second"))
                                                    }, null, 8, [
                                                        "tooltip"
                                                    ]),
                                                    ce("h1", null, ue(t(n)("hsqe.auditInspection.qualitySafetyInspection.formTitle")), 1)
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                "header-extra": u(()=>[
                                        t(r) === "first" ? (h(), P(i, {
                                            key: "nextStep",
                                            tooltip: t(n)("hsqe.auditInspection.vesselInspection.next"),
                                            iconName: "nextStep",
                                            iconType: "lineIcon",
                                            class: "cursor-pointer",
                                            onClick: J
                                        }, null, 8, [
                                            "tooltip"
                                        ])) : D("", !0)
                                    ]),
                                default: u(()=>[
                                        t(r) === "first" ? (h(), x("div", De, [
                                            p(Q, {
                                                ref: "formRef",
                                                onRegister: t($)
                                            }, {
                                                visitPlace: u(({ model: s, field: w })=>[
                                                        p(Z, {
                                                            ref: "portTableSelectRef",
                                                            labelField: "port",
                                                            valueField: "id",
                                                            value: s[w],
                                                            "onUpdate:value": (v)=>s[w] = v,
                                                            formValues: t(b),
                                                            "onUpdate:formValues": e[1] || (e[1] = (v)=>R(b) ? b.value = v : null),
                                                            multiple: !1,
                                                            formProps: F,
                                                            disabled: t(E),
                                                            selectTitle: t(n)("hsqe.planner.modal.selectPort"),
                                                            tableProps: {
                                                                rowKey: (v)=>v.id,
                                                                request: j,
                                                                columns: L,
                                                                pagination: {
                                                                    simple: !0
                                                                }
                                                            },
                                                            class: "w-full"
                                                        }, null, 8, [
                                                            "value",
                                                            "onUpdate:value",
                                                            "formValues",
                                                            "disabled",
                                                            "selectTitle",
                                                            "tableProps"
                                                        ])
                                                    ]),
                                                _: 1
                                            }, 8, [
                                                "onRegister"
                                            ])
                                        ])) : D("", !0),
                                        t(r) === "second" ? (h(), x("div", Re, [
                                            p(ve, {
                                                modelValue: t(f),
                                                "onUpdate:modelValue": e[2] || (e[2] = (s)=>R(f) ? f.value = s : null),
                                                class: "mb-[10px]",
                                                onChangeTab: K
                                            }, null, 8, [
                                                "modelValue"
                                            ]),
                                            (h(), P(le(t(N)), {
                                                formData: t(a),
                                                "onUpdate:formData": e[3] || (e[3] = (s)=>R(a) ? a.value = s : null),
                                                key: t(d),
                                                currentTab: t(d),
                                                tabReadonly: !t(q)
                                            }, null, 40, [
                                                "formData",
                                                "currentTab",
                                                "tabReadonly"
                                            ]))
                                        ])) : D("", !0)
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Ae as _, __tla };
