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 { O as P, aw as L, b as H } from "./template-rpthWlT9.js";
import { B as $ } from "./BasicForm-dL_oCSPM.js";
import { u as W } from "./useForm-CKmgcynv.js";
import { V as m, bk as k, Z, ae as j, d as G, e as K, f as Q, r as n, c as U, o as z, l as s, w as J, j as v, ac as h, cZ as X, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as Y } from "./Table-0PViRYCf.js";
import { u as ee } from "./useModal-CO65vga3.js";
let Ce;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let oe, b, te, se, ae, l, p, ne;
    oe = k();
    ({ t: b } = m());
    te = await P();
    se = [
        {
            field: "shipId",
            component: "NSelect",
            label: b("hsqe.auditInspection.vesselInspection.formVessel"),
            componentProps: {
                placeholder: b("hsqe.auditInspection.vesselInspection.formVesselHint"),
                options: te,
                "value-field": "id",
                "label-field": oe.getLocale === "en" ? "shipNameEn" : "shipName"
            }
        }
    ];
    ae = k();
    ({ t: l } = m());
    p = [
        {
            key: 0,
            value: "Open",
            valueCn: "待访船",
            color: {
                color: "#F8F0FF",
                textColor: "#7A42C4",
                borderColor: "#9089D8"
            }
        },
        {
            key: 1,
            value: "Due in 15 days",
            valueCn: "15天内到期",
            color: {
                color: "#F8F7EC",
                textColor: "#DDD12A",
                borderColor: "#E8DC38"
            }
        },
        {
            key: 2,
            value: "Due in 15 days",
            valueCn: "15天内到期",
            color: {
                color: "#F8F7EC",
                textColor: "#DDD12A",
                borderColor: "#E8DC38"
            }
        },
        {
            key: 3,
            value: "Pending Extension",
            valueCn: "延期审批中",
            color: {
                color: "#F8F2EC",
                textColor: "#CF8522",
                borderColor: "#E09B41"
            }
        },
        {
            key: 4,
            value: "Extension",
            valueCn: "延期已批准",
            color: {
                color: "#ECF1F8",
                textColor: "#2482CB",
                borderColor: "#2495EE"
            }
        },
        {
            key: 5,
            value: "Assigned Report",
            valueCn: "已创建报告",
            color: {
                color: "#F8ECF8",
                textColor: "#AC42B5",
                borderColor: "#CE81D4"
            }
        },
        {
            key: 6,
            value: "Completed",
            valueCn: "已完成",
            color: {
                color: "#ECF8F0",
                textColor: "#4C9062",
                borderColor: "#6DB484"
            }
        },
        {
            key: 7,
            value: "Overdue",
            valueCn: "已逾期",
            color: {
                color: "#F8ECEC",
                textColor: "#D3392D",
                borderColor: "#E06C63"
            }
        },
        {
            key: 8,
            value: "Canceled",
            valueCn: "已取消",
            color: {
                color: "#EFEDF4",
                textColor: "#6B6A79",
                borderColor: "#A19FB0"
            }
        }
    ];
    ne = [
        {
            type: "selection",
            multiple: !1,
            key: "selection"
        },
        {
            title: l("hsqe.auditInspection.vesselInspection.planDate"),
            key: "planDate"
        },
        {
            title: l("hsqe.auditInspection.vesselInspection.portName"),
            key: "portName"
        },
        {
            title: l("hsqe.auditInspection.vesselInspection.vessel"),
            key: "shipName"
        },
        {
            title: l("hsqe.auditInspection.vesselInspection.inspector"),
            key: "inspectorNames"
        },
        {
            title: l("hsqe.auditInspection.vesselInspection.currentStatus"),
            key: "currentStatus",
            render (r) {
                return Z(j, {
                    bordered: !1,
                    color: p.find((e)=>e.key === r.currentStatus)?.color
                }, {
                    default: ()=>ae.getLocale === "en" ? p.find((e)=>e.key === r.currentStatus)?.value : p.find((e)=>e.key === r.currentStatus)?.valueCn
                });
            }
        }
    ];
    Ce = G({
        __name: "Modal",
        emits: [
            "success"
        ],
        setup (r, { expose: e }) {
            const y = K(), F = Q(), { t: c } = m(), x = X(), g = n(), D = n(""), C = n("");
            async function E(a, t) {
                return await L({
                    currentStatus: [
                        0,
                        2,
                        4,
                        5
                    ],
                    ...a,
                    ...t,
                    subTypeIds: [
                        2,
                        3
                    ]
                });
            }
            const f = n();
            function i() {
                f.value.reload();
            }
            const [I, { getFieldsValue: _ }] = W({
                schemas: se,
                showAdvancedButton: !1,
                labelWidth: "auto",
                gridProps: {
                    cols: 2,
                    xGap: 15
                }
            }), [S, { openModal: R, setProps: T, setSubLoading: w }] = ee({
                title: c("common.addText"),
                subBtuText: c("common.okText"),
                cancelText: c("common.cancelText"),
                width: 1e3
            });
            async function B(a, t) {
                if (D.value = a, R(), t) {
                    C.value = t;
                    const u = await H({
                        templateCode: a,
                        uuid: s(C)
                    });
                    await h(), g.value?.setFieldsValue(u);
                }
            }
            async function N() {
                await h(), i();
            }
            async function q() {
                if (!o.value || !o.value.id) {
                    x.error(c("hsqe.auditInspection.vesselInspection.plannerHint")), w(!1);
                    return;
                }
                y.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection",
                    query: {
                        id: o.value.id,
                        currentStatus: o.value.currentStatus,
                        shipName: o.value.shipName,
                        portName: o.value.portName,
                        sourcePath: F.name
                    }
                });
            }
            function A() {
                i();
            }
            function M() {
                i();
            }
            const o = n(null);
            function O(a, t) {
                o.value = t[0];
            }
            return e({
                showModal: B,
                setProps: T,
                getData: N
            }), (a, t)=>{
                const u = V;
                return z(), U(u, {
                    ref: "modalRef",
                    onRegister: s(S),
                    class: "basicModal basicFormModal",
                    onOnOk: q
                }, {
                    default: J(()=>[
                            v(s($), {
                                ref: "contentFromRef",
                                onRegister: s(I),
                                onSubmit: A,
                                onReset: M
                            }, null, 8, [
                                "onRegister"
                            ]),
                            v(s(Y), {
                                ref_key: "basicTableRef",
                                ref: f,
                                columns: s(ne),
                                request: (d)=>E(d, s(_)()),
                                immediate: !1,
                                "row-key": (d)=>d.id,
                                "onUpdate:checkedRowKeys": O,
                                showTableSetting: !1
                            }, null, 8, [
                                "columns",
                                "request",
                                "row-key"
                            ])
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { Ce as _, __tla };
