import { V as g, bk as y, Z as f, ae as O, d as Z, f as G, u as J, r as c, a as K, aw as Q, c as Y, o as ee, w as n, j as o, W as te, l as u, aA as ie, H as ae, aI as se, p as oe, A as ne, B as re, i as ce, X as le, ac as ue, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as pe } from "./Table-0PViRYCf.js";
import { _ as me } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as fe } from "./BasicForm-dL_oCSPM.js";
import { u as de } from "./useForm-CKmgcynv.js";
import { c as he, e as _e, f as ge } from "./certificate-6_B4mutd.js";
import { a as ye } from "./planner-BebmniHR.js";
import { _ as be, __tla as __tla_1 } from "./CreateModal.vue_vue_type_script_setup_true_lang-DD8S0QvX.js";
import { _ as qe } from "./History.vue_vue_type_script_setup_true_lang-zC8t_ZJ3.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 "./account-C850CBTF.js";
import "./hook-C9rOLWu_.js";
import "./template-rpthWlT9.js";
import "./base64-BbY-I90a.js";
let dt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let ve, s, _, xe, ke, h, t, we;
    ve = y();
    ({ t: s } = g());
    _ = await ye();
    xe = [
        {
            field: "shipId",
            component: "NSelect",
            label: s("hsqe.auditInspection.vesselInspection.formVessel"),
            componentProps: {
                defaultValue: _[0].id,
                placeholder: s("hsqe.auditInspection.vesselInspection.formVesselHint"),
                options: _,
                "value-field": "id",
                "label-field": ve.getLocale === "en" ? "shipNameEn" : "shipName"
            }
        },
        {
            field: "category",
            slot: "Category",
            label: s("hsqe.certificate.type")
        },
        {
            field: "status",
            component: "NSelect",
            label: s("hsqe.certificate.status"),
            giProps: {
                span: 1
            },
            componentProps: {
                placeholder: s("hsqe.certificate.status"),
                options: [
                    {
                        label: s("hsqe.certificate.pending"),
                        value: 0
                    },
                    {
                        label: s("hsqe.certificate.normal"),
                        value: 1
                    },
                    {
                        label: s("hsqe.certificate.expiringin3months"),
                        value: 2
                    },
                    {
                        label: s("hsqe.certificate.expiringin2months"),
                        value: 3
                    },
                    {
                        label: s("hsqe.certificate.expiringin2weeks"),
                        value: 4
                    },
                    {
                        label: s("hsqe.certificate.expired"),
                        value: 5
                    }
                ]
            }
        }
    ];
    ke = ()=>_[0].id;
    h = y();
    ({ t } = g());
    we = [
        {
            title: t("hsqe.certificate.no"),
            key: "certificateNo",
            width: 140
        },
        {
            title: t("hsqe.certificate.Vessel"),
            key: h.getLocale === "en" ? "shipNameEn" : "shipName",
            width: 140
        },
        {
            title: t("hsqe.certificate.type"),
            key: h.getLocale === "en" ? "categoryName" : "categoryChineseName",
            width: 240
        },
        {
            title: t("hsqe.certificate.Certificatename"),
            key: h.getLocale === "en" ? "certificateEnglishName" : "certificateChineseName",
            width: 180
        },
        {
            title: t("hsqe.certificate.IssueDate"),
            key: "issueDate",
            width: 140
        },
        {
            title: t("hsqe.certificate.ExpireDate"),
            key: "expireDate",
            width: 100
        },
        {
            title: t("hsqe.certificate.status"),
            key: "status",
            width: 200,
            render (i) {
                return f(O, {
                    bordered: !1,
                    type: i.status === 0 || i.status === 1 ? "info" : i.status === 2 ? "success" : i.status === 3 ? "warning" : i.status === 4 || i.status === 5 ? "error" : "primary"
                }, {
                    default: ()=>i.status === 0 ? t("hsqe.certificate.pending") : i.status === 1 ? t("hsqe.certificate.normal") : i.status === 2 ? t("hsqe.certificate.expiringin3months") : i.status === 3 ? t("hsqe.certificate.expiringin2months") : i.status === 4 ? t("hsqe.certificate.expiringin2weeks") : i.status === 5 ? t("hsqe.certificate.expired") : ""
                });
            }
        },
        {
            title: t("hsqe.certificate.IssuedBy"),
            key: "issueBy",
            width: 140
        },
        {
            title: t("hsqe.certificate.LastEndorse"),
            key: "lastEndorse",
            width: 140
        },
        {
            title: t("hsqe.certificate.remark"),
            key: "remark",
            width: 140
        }
    ];
    dt = Z({
        __name: "index",
        setup (i) {
            const S = y(), b = G(), { t: r } = g(), q = J(), v = c(), p = c(), x = c(), k = c(!1), T = c(""), d = c([]), w = c([]), E = K({
                width: 120,
                title: r("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return f(me, {
                        style: "text",
                        actions: [
                            {
                                label: r("common.optionsViewText"),
                                labelShow: !1,
                                icon: f("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: R.bind(null, e)
                            },
                            {
                                label: r("hsqe.certificate.History"),
                                labelShow: !1,
                                icon: f("i", {
                                    class: "iconfont icon-Log text-[14px]"
                                }),
                                onClick: V.bind(null, e)
                            }
                        ]
                    });
                }
            });
            function V(e) {
                x.value?.showModal(e.id);
            }
            const B = async (e, a)=>await he({
                    ...e,
                    ...a
                });
            function m(e) {
                v.value[e ? "restReload" : "reload"]();
            }
            function R(e) {
                k.value = !0, p.value.setProps({
                    title: r("hsqe.certificate.viewCertificate")
                }), p.value.getData(e.id, !0), p.value.openModal();
            }
            function I(e) {
                m(!0);
            }
            function A(e) {
                m();
            }
            const [D, { getFieldsValue: M, setFieldsValue: P }] = de({
                gridProps: {
                    cols: "6"
                },
                schemas: xe,
                showAdvancedButton: !1
            });
            async function $() {
                let e = ke();
                if (e) {
                    const a = await _e(e);
                    a ? (console.log(a), window.open(a, "_blank")) : q.error(r("hsqe.noticeCircular.fileError"));
                } else q.error(r("hsqe.noticeCircular.fileErrorTip"));
            }
            async function F() {
                let e = await ge();
                d.value = e, d.value && (w.value = d.value.map((a)=>({
                        label: S.getLocale === "en" ? a.name : a.chineseName,
                        value: a.id
                    })));
            }
            async function H() {
                b.query.status && await P({
                    status: +b.query.status
                }), await ue(), m(), F();
            }
            return Q(()=>{
                H();
            }), (e, a)=>{
                const C = ie, N = te, W = re, U = se, X = ae, j = le;
                return ee(), Y(j, null, {
                    default: n(()=>[
                            o(N, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: n(()=>[
                                        o(u(fe), {
                                            onRegister: u(D),
                                            onSubmit: I,
                                            onReset: A
                                        }, {
                                            Category: n(({ model: l, field: L })=>[
                                                    o(C, {
                                                        value: l[L],
                                                        "onUpdate:value": (z)=>l[L] = z,
                                                        filterable: "",
                                                        clearable: "",
                                                        options: w.value
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value",
                                                        "options"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            o(N, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: n(()=>[
                                        o(u(pe), {
                                            columns: u(we),
                                            request: (l)=>B(l, u(M)()),
                                            "row-key": (l)=>l.id,
                                            ref_key: "basicTableRef",
                                            ref: v,
                                            immediate: !1,
                                            actionColumn: E,
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, {
                                            tableTitle: n(()=>[
                                                    o(X, null, {
                                                        default: n(()=>[
                                                                o(U, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: n(()=>[
                                                                            o(W, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: $
                                                                            }, {
                                                                                icon: n(()=>a[0] || (a[0] = [
                                                                                        ce("i", {
                                                                                            class: "iconfont icon-Export"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: n(()=>[
                                                                            oe(" " + ne(u(r)("common.exportText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            o(be, {
                                ref_key: "createModalRef",
                                ref: p,
                                title: T.value,
                                isEdit: k.value,
                                onSuccess: m
                            }, null, 8, [
                                "title",
                                "isEdit"
                            ]),
                            o(qe, {
                                ref_key: "HistoryRef",
                                ref: x
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { dt as default, __tla };
