import { V as C, bk as ve, Z as f, ae as ye, d as he, cq as be, ar as we, e as ke, f as xe, r as u, a as qe, cZ as Te, aw as Ce, c as E, o as V, w as n, j as i, U as Se, M as Ne, W as Ie, i as k, c8 as Me, ds as A, l as a, c9 as Pe, p as y, A as x, aI as Re, B as De, cB as Ee, H as Ve, D as Ae, S as Be, X as Oe, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as Ke } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { B as Fe } from "./BasicForm-dL_oCSPM.js";
import { u as We } from "./useForm-CKmgcynv.js";
import { B as $e } from "./Table-0PViRYCf.js";
import { _ as ze } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { s as Ge, e as He, c as B, d as Le, f as Ue } from "./meeting-Cq-av6G8.js";
import { X as Qe } from "./template-rpthWlT9.js";
import { g as Xe } from "./base64-BbY-I90a.js";
import { u as je } from "./useModal-CO65vga3.js";
import { _ as Ze } from "./Flex-CTSf12gq.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./componentSetting-DVhNDBTO.js";
import "./ImageUpload-DUsnro3W.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./tabsView-BXskTdVh.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./propTypes-CebMRUpe.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 "./usePageCache-DluHn7Yy.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./componentMap-CElCaWis.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./print-CT_2hrjP.js";
import "./useTimeout-BxFilWvD.js";
let $t;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let Je, r, Ye, et, l, tt, nt, ot;
    Je = ve();
    ({ t: r } = C());
    Ye = await Qe();
    et = [
        {
            field: "shipId",
            component: "NSelect",
            label: r("hsqe.deficiency.vessel"),
            componentProps: {
                placeholder: r("hsqe.auditInspection.vesselInspection.formVesselHint"),
                options: Ye,
                "label-field": Je.getLocale === "en" ? "shipNameEn" : "shipName",
                "value-field": "id"
            }
        },
        {
            field: "report_status",
            component: "NSelect",
            label: r("hsqe.workpermit.Status"),
            componentProps: {
                placeholder: r("hsqe.workpermit.Status"),
                options: [
                    {
                        label: r("hsqe.meeting.Notsubmit"),
                        value: 0
                    },
                    {
                        label: r("hsqe.meeting.PendingDPAReview"),
                        value: 1
                    },
                    {
                        label: r("hsqe.meeting.PendingGMReview"),
                        value: 2
                    },
                    {
                        label: r("hsqe.meeting.Completed"),
                        value: 3
                    }
                ]
            }
        },
        {
            field: "meeting_held_from",
            label: r("hsqe.meeting.validfrom"),
            component: "NDatePicker",
            componentProps: {
                type: "date",
                valueFormat: "yyyy-MM-dd"
            }
        },
        {
            field: "meeting_held_to",
            label: r("hsqe.meeting.validto"),
            component: "NDatePicker",
            componentProps: {
                type: "date",
                valueFormat: "yyyy-MM-dd"
            }
        }
    ];
    ({ t: l } = C());
    tt = [
        {
            title: l("common.messagedefine.Num"),
            key: "num",
            width: 80,
            render: (d, o)=>o + 1
        },
        {
            title: l("hsqe.periodicalreview.reportNo"),
            key: "report_no",
            width: 160
        },
        {
            title: l("hsqe.meeting.meeting_type_name"),
            key: "meeting_type_name",
            minWidth: 120
        },
        {
            title: l("hsqe.meeting.meeting_date"),
            key: "meeting_date",
            width: 120
        },
        {
            title: l("hsqe.meeting.meeting_type_code"),
            key: "meeting_type_code",
            minWidth: 120
        },
        {
            title: l("hsqe.meeting.CompletedOn"),
            key: "meeting_held_to",
            width: 160
        },
        {
            title: l("hsqe.periodicalreview.status"),
            key: "report_status",
            width: 140,
            render (d) {
                return f(ye, {
                    bordered: !1,
                    type: d.report_status == 0 ? "info" : d.report_status == 3 ? "success" : "warning"
                }, {
                    default: ()=>d.report_status === 0 ? l("hsqe.meeting.Notsubmit") : d.report_status == 1 ? l("hsqe.meeting.PendingDPAReview") : d.report_status == 2 ? l("hsqe.meeting.PendingGMReview") : l("hsqe.meeting.Completed")
                });
            }
        }
    ];
    nt = {
        class: "pt-3"
    };
    ot = {
        class: "text-gray-600 pl-4"
    };
    $t = he({
        __name: "index",
        setup (d) {
            const { t: o } = C(), O = be(), K = we(), q = ke(), g = xe(), S = Te(), N = u(), I = u(), M = u(), P = u(), m = u(1), v = u([]), s = u([]), h = u(), b = u(), [F, { getFieldsValue: W }] = We({
                gridProps: {
                    cols: 5,
                    xGap: 10
                },
                schemas: et,
                labelWidth: "auto",
                labelPlacement: "top"
            }), $ = qe({
                width: 200,
                title: o("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return f(ze, {
                        style: "text",
                        actions: [
                            {
                                label: o("common.optionsViewText"),
                                labelShow: !1,
                                icon: f("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: Y.bind(null, e)
                            },
                            {
                                label: o("common.optionsEditText"),
                                labelShow: !1,
                                icon: f("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: Z.bind(null, e),
                                ifShow: e.report_status === 0
                            },
                            {
                                label: o("common.optionsSubmitText"),
                                labelShow: !1,
                                icon: f("i", {
                                    class: "iconfont icon-Submit size16"
                                }),
                                onClick: ae.bind(this, e),
                                ifShow: e.report_status === 0
                            },
                            {
                                label: o("common.optionsExportText"),
                                labelShow: !1,
                                onClick: le.bind(this, e),
                                icon: f("i", {
                                    class: "iconfont icon-Export size16"
                                }),
                                ifShow: e.report_status === 3 && e.meeting_type_code !== "meeting_vessel_general" && e.meeting_type_code !== "meeting_office_general"
                            },
                            {
                                label: o("common.optionsDelText"),
                                labelShow: !1,
                                icon: f("i", {
                                    class: "iconfont icon-Delete red"
                                }),
                                onClick: ie.bind(null, e)
                            }
                        ]
                    });
                }
            }), z = ()=>{
                s.value = [], c();
            }, G = ()=>{
                H();
            }, H = async ()=>{
                const e = await B();
                m.value === 1 ? (v.value = e.vessel, s.value = [
                    e.vessel[0].children[0].id
                ]) : (v.value = e.office, s.value = [
                    e.office[0].children[0].id
                ]), c();
            }, L = async ()=>{
                m.value = g.query.VesselorOfficeType === "office" ? 2 : 1;
                const e = await B();
                m.value === 1 ? (v.value = e.vessel, s.value = Number(g.query.treeItemKeyNumber) ? [
                    Number(g.query.treeItemKeyNumber)
                ] : [
                    e.vessel[0].children[0].id
                ], b.value = e.vessel[0].children[0].meetingTypeCode, h.value = e.vessel[0].children[0].nameEn) : (v.value = e.office, s.value = Number(g.query.treeItemKeyNumber) ? [
                    Number(g.query.treeItemKeyNumber)
                ] : [
                    e.office[0].children[0].id
                ], b.value = e.office[0].children[0].meetingTypeCode, h.value = e.office[0].children[0].nameEn), c();
            };
            async function U(e, t) {
                s.value = e, b.value = t[0].meetingTypeCode, h.value = t[0].nameEn, c();
            }
            function Q() {
                q.push({
                    name: "Add_HSQE_meeting",
                    query: {
                        uuid: "",
                        treeItemKey: s.value[0],
                        meetingTypeCode: b.value,
                        treeItemname: h.value,
                        viewworkpermit: "add",
                        location: m.value === 1 ? "vessel" : "office"
                    }
                });
            }
            function X(e) {
                c();
            }
            function j(e) {
                c();
            }
            function c() {
                N.value.reload();
            }
            async function Z(e) {
                q.push({
                    name: "Add_HSQE_meeting",
                    query: {
                        uuid: e.uuid,
                        treeItemKey: s.value[0],
                        meetingTypeCode: e.meeting_type_code,
                        treeItemname: e.meeting_type_name,
                        viewworkpermit: "edit",
                        location: m.value === 1 ? "vessel" : "office"
                    }
                });
            }
            async function J(e, t) {
                var _ = {
                    ...e,
                    ...t,
                    meeting_type_id: s.value[0] ? s.value[0] : null,
                    type: m.value === 1 ? "vessel" : "office"
                };
                return Le(_);
            }
            async function Y(e) {
                q.push({
                    name: "Add_HSQE_meeting",
                    query: {
                        uuid: e.uuid,
                        treeItemKey: s.value[0],
                        meetingTypeCode: e.meeting_type_code,
                        treeItemname: e.meeting_type_name,
                        viewworkpermit: "true",
                        location: m.value === 1 ? "vessel" : "office"
                    }
                });
            }
            const [ee, { openModal: te, closeModal: ne, setSubLoading: oe }] = je({
                title: o("common.delPop.title"),
                showIcon: !0,
                type: "warning",
                closable: !1,
                maskClosable: !0,
                width: 380,
                subBtuText: o("common.okText"),
                cancelText: o("common.cancelText")
            });
            function ie(e) {
                I.value = e.report_no, M.value = e.meeting_type_code, P.value = e.uuid, te();
            }
            async function se() {
                var e = {
                    template_code: M.value,
                    uuid: P.value
                };
                await Ue(e), ne(), oe(), S.success(o("common.optionsDelSuccessText")), c();
            }
            function ae(e) {
                K.warning({
                    title: "t('hsqe.periodicalreview.Confirmsubmission')",
                    content: "t('hsqe.periodicalreview.Areyousuretosubmit')",
                    positiveText: o("common.okText"),
                    negativeText: o("common.cancelText"),
                    draggable: !0,
                    onPositiveClick: async ()=>{
                        await Ge({
                            ship_id: 181,
                            meeting_type_id: e.meeting_type_id,
                            uuid: e.uuid,
                            template_code: e.meeting_type_code
                        }), c();
                    },
                    onNegativeClick: ()=>{}
                });
            }
            async function le(e) {
                var t = {
                    meeting_type_id: e.meeting_type_id,
                    uuid: e.uuid,
                    template_code: e.meeting_type_code
                }, _ = await He(t);
                if (_) {
                    const { previewUrl: w } = O;
                    window.open(w + encodeURIComponent(Xe.encode(_)), "_blank");
                } else S.error(o("common.file.notGenerated"));
            }
            function me() {
                c(), L();
            }
            return Ce(()=>{
                me();
            }), (e, t)=>{
                const _ = Pe, w = Me, R = De, re = Re, ce = Ze, ue = Ee, T = Ie, D = Ne, pe = Ve, de = Se, _e = Be, fe = Ke, ge = Oe;
                return V(), E(ge, null, {
                    default: n(()=>[
                            i(de, {
                                cols: "1 s:1 m:1 l:4 xl:4 2xl:4",
                                responsive: "screen",
                                "x-gap": 12
                            }, {
                                default: n(()=>[
                                        i(D, {
                                            span: "1"
                                        }, {
                                            default: n(()=>[
                                                    i(T, {
                                                        segmented: {
                                                            content: "hard"
                                                        },
                                                        bordered: !1,
                                                        size: "small"
                                                    }, {
                                                        default: n(()=>[
                                                                i(ce, {
                                                                    justify: "space-between"
                                                                }, {
                                                                    default: n(()=>[
                                                                            i(w, {
                                                                                value: a(m),
                                                                                "onUpdate:value": t[0] || (t[0] = (p)=>A(m) ? m.value = p : null),
                                                                                onChange: G
                                                                            }, {
                                                                                default: n(()=>[
                                                                                        i(_, {
                                                                                            value: 1
                                                                                        }, {
                                                                                            default: n(()=>[
                                                                                                    y(x(a(o)("hsqe.periodicalreview.Vessel")), 1)
                                                                                                ]),
                                                                                            _: 1
                                                                                        }),
                                                                                        i(_, {
                                                                                            value: 2,
                                                                                            class: "ml-2"
                                                                                        }, {
                                                                                            default: n(()=>[
                                                                                                    y(x(a(o)("hsqe.periodicalreview.Office")), 1)
                                                                                                ]),
                                                                                            _: 1
                                                                                        })
                                                                                    ]),
                                                                                _: 1
                                                                            }, 8, [
                                                                                "value"
                                                                            ]),
                                                                            i(re, {
                                                                                trigger: "hover"
                                                                            }, {
                                                                                trigger: n(()=>[
                                                                                        i(R, {
                                                                                            class: "size-6",
                                                                                            type: "text",
                                                                                            onClick: t[1] || (t[1] = (p)=>z())
                                                                                        }, {
                                                                                            icon: n(()=>t[3] || (t[3] = [
                                                                                                    k("i", {
                                                                                                        class: "iconfont icon-a-Frame883 text-[14px]"
                                                                                                    }, null, -1)
                                                                                                ])),
                                                                                            _: 1
                                                                                        })
                                                                                    ]),
                                                                                default: n(()=>[
                                                                                        t[4] || (t[4] = y(" All "))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    _: 1
                                                                }),
                                                                k("div", nt, [
                                                                    i(ue, {
                                                                        "block-line": "",
                                                                        cascade: "",
                                                                        "key-field": "id",
                                                                        "label-field": "nameEn",
                                                                        "virtual-scroll": !0,
                                                                        cancelable: !1,
                                                                        hasChildren: !1,
                                                                        "default-expand-all": "",
                                                                        data: a(v),
                                                                        "selected-keys": a(s),
                                                                        "onUpdate:selectedKeys": [
                                                                            t[2] || (t[2] = (p)=>A(s) ? s.value = p : null),
                                                                            U
                                                                        ]
                                                                    }, null, 8, [
                                                                        "data",
                                                                        "selected-keys"
                                                                    ])
                                                                ])
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }),
                                        i(D, {
                                            span: "3"
                                        }, {
                                            default: n(()=>[
                                                    i(T, {
                                                        bordered: !1,
                                                        class: "mb-3 proCard"
                                                    }, {
                                                        default: n(()=>[
                                                                i(a(Fe), {
                                                                    onRegister: a(F),
                                                                    onSubmit: X,
                                                                    onReset: j
                                                                }, null, 8, [
                                                                    "onRegister"
                                                                ])
                                                            ]),
                                                        _: 1
                                                    }),
                                                    i(T, {
                                                        bordered: !1,
                                                        class: "proCard"
                                                    }, {
                                                        default: n(()=>[
                                                                i(a($e), {
                                                                    columns: a(tt),
                                                                    request: (p)=>J(p, a(W)()),
                                                                    "row-key": (p)=>p.id,
                                                                    ref_key: "basicTableRef",
                                                                    ref: N,
                                                                    autoScrollX: !0,
                                                                    "virtual-scroll": "",
                                                                    actionColumn: a($)
                                                                }, {
                                                                    tableTitle: n(()=>[
                                                                            i(pe, null, {
                                                                                default: n(()=>[
                                                                                        a(s).length !== 0 ? (V(), E(R, {
                                                                                            key: 0,
                                                                                            type: "primary",
                                                                                            strong: "",
                                                                                            bordered: "",
                                                                                            secondary: "",
                                                                                            class: "size-7",
                                                                                            onClick: Q
                                                                                        }, {
                                                                                            icon: n(()=>t[5] || (t[5] = [
                                                                                                    k("i", {
                                                                                                        class: "iconfont icon-ADD"
                                                                                                    }, null, -1)
                                                                                                ])),
                                                                                            _: 1
                                                                                        })) : Ae("", !0)
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    _: 1
                                                                }, 8, [
                                                                    "columns",
                                                                    "request",
                                                                    "row-key",
                                                                    "actionColumn"
                                                                ])
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            }),
                            i(fe, {
                                onRegister: a(ee),
                                ref: "basicModalmodalRef",
                                onOnOk: se
                            }, {
                                default: n(()=>[
                                        k("p", ot, [
                                            y(x(a(o)("common.delPop.title")) + "：", 1),
                                            i(_e, {
                                                strong: ""
                                            }, {
                                                default: n(()=>[
                                                        y(x(a(I)) + " ?", 1)
                                                    ]),
                                                _: 1
                                            })
                                        ])
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { $t as default, __tla };
