import { r as _, V as S, bk as P, Z as p, ae as V, d as L, e as A, f as D, a as M, aw as W, c as O, o as z, w as g, j as r, W as G, l, X as H, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as Q } from "./BasicForm-dL_oCSPM.js";
import { B as X } from "./Table-0PViRYCf.js";
import { _ as $ } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { v as j, s as Y, __tla as __tla_1 } from "./schemas-DLHXnB0l.js";
import { u as Z } from "./useForm-CKmgcynv.js";
import { _ as J, __tla as __tla_2 } from "./Modal.vue_vue_type_script_setup_true_lang-lMLJ7Z6q.js";
import { av as K } from "./template-rpthWlT9.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 "./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 "./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 "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./Flex-CTSf12gq.js";
let Me;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    const I = P(), { t } = S(), U = [
        {
            label: "机务访船",
            largerEn: "Technical Superintendent Inspection",
            value: 2
        },
        {
            label: "机海务访船",
            largerEn: "Marine & Technical Inspection",
            value: 3
        },
        {
            label: "总经理访船",
            largerEn: "GM Inspection",
            value: 4
        },
        {
            label: "管理层访船",
            largerEn: "Management Inspection",
            value: 5
        }
    ], x = [
        {
            key: 1,
            value: t("hsqe.auditInspection.vesselInspection.status.inProgress"),
            color: {
                color: "rgba(23,182,235,0.12)",
                textColor: "#17B6EB",
                borderColor: "rgba(23,182,235,0.5)"
            }
        },
        {
            key: 2,
            value: t("hsqe.auditInspection.vesselInspection.status.inProgress"),
            color: {
                color: "rgba(23,182,235,0.12)",
                textColor: "#17B6EB",
                borderColor: "rgba(23,182,235,0.5)"
            }
        },
        {
            key: 3,
            value: t("hsqe.auditInspection.vesselInspection.status.approval"),
            color: {
                color: "rgba(83,157,244,0.12)",
                textColor: "#2180F1",
                borderColor: "rgba(83,157,244,0.5)"
            }
        },
        {
            key: 4,
            value: t("hsqe.auditInspection.vesselInspection.status.returned"),
            color: {
                color: "rgba(220,116,116,0.12)",
                textColor: "#D24C4C",
                borderColor: "rgba(220,116,116,0.5)"
            }
        },
        {
            key: 5,
            value: t("hsqe.auditInspection.vesselInspection.status.completed"),
            color: {
                color: "rgba(63,195,63,0.12)",
                textColor: "#3FC33F",
                borderColor: "rgba(63,195,63,0.5)"
            }
        }
    ];
    function ee() {
        const m = _(), s = _();
        return {
            columns: [
                {
                    title: t("hsqe.planner.no"),
                    key: "",
                    width: 60,
                    render (o, n) {
                        return (m.value - 1) * s.value + n + 1;
                    }
                },
                {
                    title: t("hsqe.auditInspection.vesselInspection.vessel"),
                    key: I.getLocale === "en" ? "shipNameEn" : "shipName",
                    width: 140
                },
                {
                    title: t("hsqe.auditInspection.vesselInspection.reportNum"),
                    key: "reportNum",
                    width: 140
                },
                {
                    title: t("hsqe.auditInspection.vesselInspection.reportType"),
                    key: "visitType",
                    width: 140,
                    render (o) {
                        const n = U.find((d)=>d.value === o.visitType);
                        return I.getLocale === "en" ? n?.largerEn || "" : n?.label || "";
                    }
                },
                {
                    title: t("hsqe.auditInspection.vesselInspection.reportDate"),
                    key: "reportDate",
                    width: 140
                },
                {
                    title: t("hsqe.auditInspection.vesselInspection.reporter"),
                    key: "reportBy",
                    width: 140
                },
                {
                    title: t("hsqe.auditInspection.vesselInspection.reportStatus"),
                    key: "status",
                    width: 180,
                    render (o) {
                        return p(V, {
                            color: x.find((n)=>n.key === o.approveStatus)?.color
                        }, {
                            default: ()=>x.find((n)=>n.key === o.approveStatus)?.value
                        });
                    }
                }
            ],
            methods: {
                setPage: (o)=>{
                    m.value = o.pageNum, s.value = o.pageSize;
                }
            }
        };
    }
    Me = L({
        __name: "index",
        setup (m) {
            const s = A(), c = D(), { t: i } = S(), { columns: o, methods: n } = ee(), { setPage: d } = n, { templateCode: w } = j(), [C, { getFieldsValue: b }] = Z({
                schemas: Y,
                labelWidth: "60px",
                gridProps: {
                    cols: 6,
                    xGap: 15
                },
                showAdvancedButton: !1
            }), k = M({
                width: 180,
                title: i("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return p($, {
                        style: "text",
                        actions: [
                            {
                                label: i("common.optionsViewText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: N.bind(this, e)
                            },
                            {
                                label: i("common.optionsEditText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-a-Frame28 text-[20px]"
                                }),
                                onClick: B.bind(this, e),
                                ifShow: e.updateEnable == 1 && (e.approveStatus == 1 || e.approveStatus == 2 || e.approveStatus == 4)
                            },
                            {
                                label: i("common.optionsExportListText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-Export text-[15px]"
                                }),
                                onClick: T.bind(this, e)
                            }
                        ]
                    });
                }
            }), h = _();
            function q() {
                f();
            }
            function E() {
                h.value.reload();
            }
            function T(e) {
                const a = s.resolve({
                    name: "component_pdfPrint",
                    query: {
                        pageName: "VesselInspectionReport",
                        uuid: e.uuid,
                        type: "view",
                        shipName: e.shipName,
                        sourcePath: String(c.name)
                    }
                });
                window.open(a.href, "_blank");
            }
            function N(e) {
                s.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection",
                    query: {
                        uuid: e.uuid,
                        type: "view",
                        shipName: e.shipName,
                        sourcePath: String(c.name)
                    }
                });
            }
            function B(e) {
                s.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection",
                    query: {
                        uuid: e.uuid,
                        type: "edit",
                        shipName: e.shipName,
                        sourcePath: String(c.name)
                    }
                });
            }
            function f() {
                h.value.reload();
            }
            async function R(e, a) {
                d(e);
                const u = b().year;
                return u && (a.year = new Date(u).getFullYear().toString()), await K({
                    templateCode: w,
                    ...e,
                    ...a
                });
            }
            return W(async ()=>{
                f();
            }), (e, a)=>{
                const u = Q, y = G, F = H;
                return z(), O(F, null, {
                    default: g(()=>[
                            r(y, {
                                class: "mb-2 proCard"
                            }, {
                                default: g(()=>[
                                        r(u, {
                                            onRegister: l(C),
                                            onSubmit: q,
                                            onReset: E
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            r(y, {
                                class: "proCard"
                            }, {
                                default: g(()=>[
                                        r(l(X), {
                                            ref_key: "basicTableRef",
                                            ref: h,
                                            columns: l(o),
                                            request: (v)=>R(v, l(b)()),
                                            immediate: !1,
                                            "row-key": (v)=>v.id,
                                            actionColumn: l(k),
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, null, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            r(J, {
                                ref: "modalRef",
                                onSuccess: f
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Me as default, __tla };
