import { V as v, bk as b, Z as u, ae as N, d as M, r as l, a as V, ac as P, aw as $, c as D, o as F, w as i, j as t, W, l as c, H, aI as O, p as X, B as j, i as z, X as K, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as U } from "./Table-0PViRYCf.js";
import { _ as Z } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as G } from "./BasicForm-dL_oCSPM.js";
import { u as J } from "./useForm-CKmgcynv.js";
import { f as Q } from "./survey-50B41bWV.js";
import { k as Y } from "./certificate-6_B4mutd.js";
import { _ as ee, __tla as __tla_1 } from "./CreateModal.vue_vue_type_script_setup_true_lang-BX5ppp9U.js";
import { _ as te } from "./Log.vue_vue_type_script_setup_true_lang-B1MC4_Ol.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 "./TimelineItem-Bkds7ZW8.js";
let Ke;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let oe, p, ie, ne, ae, o, se;
    oe = b();
    ({ t: p } = v());
    ie = await Y();
    ne = [
        {
            field: "vesselType",
            component: "NSelect",
            label: p("hsqe.certificate.VesselType"),
            componentProps: {
                options: ie,
                "label-field": oe.getLocale === "en" ? "name" : "chineseName",
                "value-field": "id"
            }
        },
        {
            field: "active",
            component: "NSelect",
            label: p("hsqe.certificate.IncludenactiveCertificates"),
            componentProps: {
                options: [
                    {
                        label: p("hsqe.certificate.Active"),
                        value: 0
                    },
                    {
                        label: p("hsqe.certificate.Inactive"),
                        value: 1
                    }
                ]
            }
        }
    ];
    ae = b();
    ({ t: o } = v());
    se = [
        {
            title: o("hsqe.Survey.no"),
            key: "no",
            width: 140
        },
        {
            title: o("hsqe.Survey.SurveyType"),
            key: ae.getLocale === "en" ? "englishType" : "chineseType",
            width: 140
        },
        {
            title: o("hsqe.certificate.VesselType"),
            key: "vesselType",
            width: 140,
            render (s) {
                return s.vesselType === 2 ? o("hsqe.workpermit.OILCHEMICALSTANKER") : o("hsqe.workpermit.drybulk");
            }
        },
        {
            title: o("hsqe.certificate.IncludenactiveCertificates"),
            key: "active",
            width: 120,
            render (s) {
                return u(N, {
                    bordered: !1,
                    type: s.active === 0 ? "success" : "warning"
                }, {
                    default: ()=>s.active === 0 ? o("hsqe.certificate.Active") : o("hsqe.certificate.Inactive")
                });
            }
        },
        {
            title: o("hsqe.Survey.FillingExplanation"),
            key: "fillingExplanation",
            width: 140
        }
    ];
    Ke = M({
        __name: "index",
        setup (s) {
            const { t: r } = v(), y = l(), n = l(), h = l(), m = l(!1), k = l(""), T = V({
                width: 120,
                title: r("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return u(Z, {
                        style: "text",
                        actions: [
                            {
                                label: r("common.optionsEditText"),
                                labelShow: !1,
                                icon: u("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: q.bind(null, e)
                            },
                            {
                                label: r("hsqe.certificate.Log"),
                                labelShow: !1,
                                icon: u("i", {
                                    class: "iconfont icon-Log text-[16px]"
                                }),
                                onClick: S.bind(null, e)
                            }
                        ]
                    });
                }
            });
            function S(e) {
                h.value?.showModal(e.id);
            }
            const w = async (e, a)=>await Q({
                    ...e,
                    ...a
                });
            function d(e) {
                y.value[e ? "restReload" : "reload"]();
            }
            function q(e) {
                g(), P(()=>{
                    m.value = !0, n.value.setProps({
                        title: r("hsqe.Survey.EditSurvey")
                    }), n.value.getData(e.id);
                });
            }
            function C(e) {
                d(!0);
            }
            function x(e) {
                d();
            }
            const [L, { getFieldsValue: R }] = J({
                gridProps: {
                    cols: "6"
                },
                schemas: ne,
                showAdvancedButton: !1
            });
            function g() {
                m.value = !1, n.value.setProps({
                    title: r("hsqe.Survey.AddSurvey")
                }), n.value.getData(null), n.value.openModal();
            }
            return $(()=>{}), (e, a)=>{
                const f = W, B = j, E = O, A = H, I = K;
                return F(), D(I, null, {
                    default: i(()=>[
                            t(f, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: i(()=>[
                                        t(c(G), {
                                            onRegister: c(L),
                                            onSubmit: C,
                                            onReset: x
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            t(f, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: i(()=>[
                                        t(c(U), {
                                            columns: c(se),
                                            request: (_)=>w(_, c(R)()),
                                            "row-key": (_)=>_.id,
                                            ref_key: "basicTableRef",
                                            ref: y,
                                            actionColumn: T,
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, {
                                            tableTitle: i(()=>[
                                                    t(A, null, {
                                                        default: i(()=>[
                                                                t(E, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: i(()=>[
                                                                            t(B, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: g
                                                                            }, {
                                                                                icon: i(()=>a[0] || (a[0] = [
                                                                                        z("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: i(()=>[
                                                                            a[1] || (a[1] = X(" Add "))
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            t(ee, {
                                ref_key: "createModalRef",
                                ref: n,
                                title: k.value,
                                isEdit: m.value,
                                onSuccess: d
                            }, null, 8, [
                                "title",
                                "isEdit"
                            ]),
                            t(te, {
                                ref_key: "LogRef",
                                ref: h
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Ke as default, __tla };
