import { V as _, bk as y, Z as m, ae as X, d as j, u as z, r as l, a as O, aw as Z, c as G, o as J, w as i, j as a, W as K, l as u, aA as Q, H as Y, aI as ee, p as te, A as se, B as oe, i as ne, X as ae, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as ie } from "./Table-0PViRYCf.js";
import { _ as re } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as le } from "./BasicForm-dL_oCSPM.js";
import { u as ce } from "./useForm-CKmgcynv.js";
import { e as ue, f as pe } from "./certificate-6_B4mutd.js";
import { a as me } from "./survey-50B41bWV.js";
import { a as de } from "./planner-BebmniHR.js";
import { _ as fe } from "./CreateModal.vue_vue_type_script_setup_true_lang-E6kFxTFz.js";
import { _ as he } from "./History.vue_vue_type_script_setup_true_lang-Dy1VEiAt.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./componentMap-CElCaWis.js";
import "./propTypes-CebMRUpe.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./print-CT_2hrjP.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./useModal-CO65vga3.js";
import "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./ImageUpload-DUsnro3W.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./BasicSelect-C_uwzMkE.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./dictionary-BRse4lkf.js";
import "./index-DkvzUEqh.js";
import "./index-kKnqLkWM.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./hook-C9rOLWu_.js";
let rt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let _e, o, ye, ve, T, n, ge;
    _e = y();
    ({ t: o } = _());
    ye = await de();
    ve = [
        {
            field: "shipId",
            component: "NSelect",
            label: o("hsqe.auditInspection.vesselInspection.formVessel"),
            componentProps: {
                placeholder: o("hsqe.auditInspection.vesselInspection.formVesselHint"),
                options: ye,
                "value-field": "id",
                "label-field": _e.getLocale === "en" ? "shipNameEn" : "shipName"
            }
        },
        {
            field: "status",
            component: "NSelect",
            label: o("hsqe.certificate.status"),
            giProps: {
                span: 1
            },
            componentProps: {
                placeholder: o("hsqe.certificate.status"),
                options: [
                    {
                        label: o("hsqe.survey.pending"),
                        value: 0
                    },
                    {
                        label: o("hsqe.survey.normal"),
                        value: 1
                    },
                    {
                        label: o("hsqe.survey.expiringin3months"),
                        value: 2
                    },
                    {
                        label: o("hsqe.survey.expiringin2months"),
                        value: 3
                    },
                    {
                        label: o("hsqe.survey.expired"),
                        value: 5
                    }
                ]
            }
        },
        {
            field: "surveyTypeEnglish",
            component: "NInput",
            label: o("hsqe.Survey.SurveyTypeEnglish"),
            giProps: {
                span: 1
            },
            componentProps: {
                placeholder: o("hsqe.Survey.SurveyTypeEnglish")
            }
        }
    ];
    T = y();
    ({ t: n } = _());
    ge = [
        {
            title: "No.",
            key: "num",
            width: 60,
            render: (t, d)=>d + 1
        },
        {
            title: n("hsqe.certificate.Vessel"),
            key: T.getLocale === "en" ? "shipNameEn" : "shipName",
            width: 140
        },
        {
            title: n("hsqe.Survey.SurveyType"),
            key: T.getLocale === "en" ? "surveyTypeEnglish" : "surveyTypeChinese",
            width: 240
        },
        {
            title: n("hsqe.Survey.SurveyDate"),
            key: "surveyDate",
            width: 180
        },
        {
            title: n("hsqe.Survey.WindowStart"),
            key: "windowStart",
            width: 180
        },
        {
            title: n("hsqe.Survey.WindowEnd"),
            key: "windowEnd",
            width: 180
        },
        {
            title: n("hsqe.certificate.status"),
            key: "status",
            width: 180,
            render (t) {
                return m(X, {
                    bordered: !1,
                    type: t.status === 0 || t.status === 1 || t.status === 2 ? "success" : t.status === 3 ? "warning" : t.status === 4 ? "error" : "primary"
                }, {
                    default: ()=>t.status === 0 ? n("hsqe.survey.pending") : t.status === 1 ? n("hsqe.survey.normal") : t.status === 2 ? n("hsqe.survey.expiringin3months") : t.status === 3 ? n("hsqe.survey.expiringin2months") : t.status === 4 ? n("hsqe.survey.expired") : ""
                });
            }
        }
    ];
    rt = j({
        __name: "index",
        setup (t) {
            const d = y(), { t: r } = _(), v = z(), g = l(), p = l(), b = l(), S = l(!1), L = l(""), f = l([]), q = l([]), N = O({
                width: 120,
                title: r("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return m(re, {
                        style: "text",
                        actions: [
                            {
                                label: r("common.optionsViewText"),
                                labelShow: !1,
                                icon: m("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: V.bind(null, e)
                            },
                            {
                                label: r("hsqe.certificate.History"),
                                labelShow: !1,
                                icon: m("i", {
                                    class: "iconfont icon-Log text-[14px]"
                                }),
                                onClick: E.bind(null, e)
                            }
                        ]
                    });
                }
            });
            function E(e) {
                b.value?.showModal(e.id);
            }
            const R = async (e, s)=>await me({
                    ...e,
                    ...s
                });
            function h(e) {
                g.value[e ? "restReload" : "reload"]();
            }
            function V(e) {
                S.value = !0, p.value.setProps({
                    title: r("hsqe.Survey.viewSurvey")
                }), p.value.getData(e.id, !0), p.value.openModal();
            }
            function B(e) {
                h(!0);
            }
            function I(e) {
                h();
            }
            const [A, { getFieldsValue: w }] = ce({
                gridProps: {
                    cols: "6"
                },
                schemas: ve,
                showAdvancedButton: !1
            });
            async function P() {
                let e = w().shipId;
                if (e) {
                    const s = await ue(e);
                    s ? window.open(s, "_blank") : v.error(r("hsqe.noticeCircular.fileError"));
                } else v.error(r("hsqe.noticeCircular.fileErrorTip"));
            }
            async function M() {
                let e = await pe();
                f.value = e, f.value && (q.value = f.value.map((s)=>({
                        label: d.getLocale === "en" ? s.name : s.chineseName,
                        value: s.id
                    })));
            }
            async function $() {
                M();
            }
            return Z(()=>{
                $();
            }), (e, s)=>{
                const x = Q, k = K, D = oe, H = ee, W = Y, F = ae;
                return J(), G(F, null, {
                    default: i(()=>[
                            a(k, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: i(()=>[
                                        a(u(le), {
                                            onRegister: u(A),
                                            onSubmit: B,
                                            onReset: I
                                        }, {
                                            Category: i(({ model: c, field: C })=>[
                                                    a(x, {
                                                        value: c[C],
                                                        "onUpdate:value": (U)=>c[C] = U,
                                                        filterable: "",
                                                        clearable: "",
                                                        options: q.value
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value",
                                                        "options"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(k, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: i(()=>[
                                        a(u(ie), {
                                            columns: u(ge),
                                            request: (c)=>R(c, u(w)()),
                                            "row-key": (c)=>c.id,
                                            ref_key: "basicTableRef",
                                            ref: g,
                                            actionColumn: N,
                                            autoScrollX: !0,
                                            immediate: !0,
                                            "virtual-scroll": ""
                                        }, {
                                            tableTitle: i(()=>[
                                                    a(W, null, {
                                                        default: i(()=>[
                                                                a(H, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: i(()=>[
                                                                            a(D, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: P
                                                                            }, {
                                                                                icon: i(()=>s[0] || (s[0] = [
                                                                                        ne("i", {
                                                                                            class: "iconfont icon-Export"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: i(()=>[
                                                                            te(" " + se(u(r)("common.exportText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(fe, {
                                ref_key: "createModalRef",
                                ref: p,
                                title: L.value,
                                isEdit: S.value,
                                onSuccess: h
                            }, null, 8, [
                                "title",
                                "isEdit"
                            ]),
                            a(he, {
                                ref_key: "HistoryRef",
                                ref: b
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { rt as default, __tla };
