import { _ as v } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { u as x } from "./useModal-CO65vga3.js";
import { B as g } from "./Table-0PViRYCf.js";
import { _ as N } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { a as T } from "./vesselsCertificate-Hd_5oIk8.js";
import { _ as b, __tla as __tla_0 } from "./index.vue_vue_type_script_setup_true_lang-iEGRsa4Z.js";
import { V as d, bk as B, d as D, a as l, bl as M, Z as f, fc as R, aj as L, c as A, o as E, l as o, w as O, j as m, __tla as __tla_1 } from "./index-9PRMimni.js";
import { o as S } from "./omit-B2_8Y6O_.js";
let z;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: e } = d(), u = B();
    function V() {
        return [
            {
                title: e("vesselsCertificate.no"),
                key: "no",
                width: 60,
                render: (h, r)=>r + 1
            },
            {
                title: e("vesselsCertificate.certificateCategory"),
                key: u.getLocale === "en" ? "categoryName" : "categoryChineseName",
                width: 150
            },
            {
                title: e("vesselsCertificate.certificateTypeNo"),
                key: "certificateConfigNo",
                width: 160
            },
            {
                title: e("vesselsCertificate.certificateType"),
                key: u.getLocale === "en" ? "typeName" : "typeChineseName",
                width: 150
            },
            {
                title: e("vesselsCertificate.certificateNameEn"),
                key: "certificateEnglishName",
                width: 170
            },
            {
                title: e("vesselsCertificate.certificateNameCn"),
                key: "certificateChineseName",
                width: 170
            },
            {
                title: e("vesselsCertificate.certificateNo"),
                key: "certificateNo",
                width: 120
            },
            {
                title: e("vesselsCertificate.authority"),
                key: "issueBy",
                width: 110
            },
            {
                title: e("vesselsCertificate.issueDate"),
                key: "issueDate",
                width: 110
            },
            {
                title: e("vesselsCertificate.expireDate"),
                key: "expireDate",
                width: 110
            },
            {
                title: e("vesselsCertificate.updateDate"),
                key: "updateTime",
                width: 100
            },
            {
                title: e("vesselsCertificate.updateBy"),
                key: "updateBy",
                width: 100
            },
            {
                title: e("vesselsCertificate.remark"),
                key: "remark",
                width: 200
            }
        ];
    }
    z = D({
        __name: "index",
        emits: [
            "refresh"
        ],
        setup (h, { expose: r, emit: j }) {
            const { t: i } = d(), c = l({}), n = M("infoModalRef"), [y, { openModal: p }] = x({
                title: i("vesselsCertificate.history"),
                subBtuText: i("common.okText"),
                cancelText: i("common.cancelText"),
                width: 1200
            }), C = l({
                width: 100,
                title: i("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (t) {
                    return f(N, {
                        style: "text",
                        actions: [
                            {
                                label: i("common.optionsViewText"),
                                labelShow: !1,
                                icon: f(R, {
                                    class: "text-[#2180F1] text-[14px]"
                                }),
                                onClick: w.bind(null, t)
                            }
                        ]
                    });
                }
            });
            function w(t) {
                const a = L({
                    ...S(t, [
                        "historyAttachmentList"
                    ]),
                    certificateAttachmentEntities: t.historyAttachmentList
                });
                n.value?.handleOpenModal({
                    mode: "view",
                    record: a
                });
            }
            async function k(t, a = c) {
                try {
                    return a.certificateId || Promise.reject(), await T({
                        ...t,
                        ...a
                    });
                } catch  {
                    return {
                        list: [],
                        total: 0
                    };
                }
            }
            function _({ record: t }) {
                c.certificateId = t?.id ?? void 0, p();
            }
            return r({
                handleOpenModal: _
            }), (t, a)=>(E(), A(o(v), {
                    onRegister: o(y),
                    showAction: !1
                }, {
                    default: O(()=>[
                            m(o(g), {
                                columns: o(V)(),
                                request: (s)=>k(s),
                                "row-key": (s)=>s.id,
                                autoScrollX: !0,
                                "virtual-scroll": "",
                                actionColumn: o(C)
                            }, null, 8, [
                                "columns",
                                "request",
                                "row-key",
                                "actionColumn"
                            ]),
                            m(b, {
                                ref_key: "infoModalRef",
                                ref: n
                            }, null, 512)
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]));
        }
    });
});
export { z as _, __tla };
