import { _ as L } 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 $, b as H } from "./template-rpthWlT9.js";
import { B as W } from "./BasicForm-dL_oCSPM.js";
import { u as Z } from "./useForm-CKmgcynv.js";
import { B as j } from "./Table-0PViRYCf.js";
import { V as d, bk as F, Z as G, ae as K, d as Q, e as U, r as n, c as z, o as J, w as X, j as h, l as r, ac as k, cZ as Y, __tla as __tla_0 } from "./index-9PRMimni.js";
import { u as ee } from "./useModal-CO65vga3.js";
import "./index-kKnqLkWM.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 "./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";
import "./Flex-CTSf12gq.js";
let Pe;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const oe = F(), { t: b } = d(), te = await P();
    function se() {
        return {
            schemas: [
                {
                    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"
                    }
                }
            ]
        };
    }
    const y = F(), { t: i } = d(), m = [
        {
            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"
            }
        }
    ];
    function re() {
        return {
            columns: [
                {
                    type: "selection",
                    key: "selection",
                    multiple: !1
                },
                {
                    title: i("hsqe.auditInspection.vesselInspection.planDate"),
                    key: "planDate"
                },
                {
                    title: i("hsqe.auditInspection.vesselInspection.portName"),
                    key: "portName"
                },
                {
                    title: i("hsqe.auditInspection.vesselInspection.vessel"),
                    key: y.getLocale === "en" ? "shipNameEn" : "shipName"
                },
                {
                    title: i("hsqe.auditInspection.vesselInspection.inspector"),
                    key: "inspectorNames"
                },
                {
                    title: i("hsqe.auditInspection.vesselInspection.currentStatus"),
                    key: "currentStatus",
                    render (a) {
                        return G(K, {
                            bordered: !1,
                            color: m.find((s)=>s.key === a.currentStatus)?.color
                        }, {
                            default: ()=>y.getLocale === "en" ? m.find((s)=>s.key === a.currentStatus)?.value : m.find((s)=>s.key === a.currentStatus)?.valueCn
                        });
                    }
                }
            ]
        };
    }
    Pe = Q({
        __name: "Modal",
        setup (C, { expose: a }) {
            const s = U(), { t: c } = d(), E = Y(), f = n(), I = n(), g = n(), x = n(""), v = n(""), { columns: D } = re(), { schemas: S } = se(), o = n({
                id: 0,
                currentStatus: "",
                shipName: "",
                shipNameEn: "",
                portName: "",
                shipId: ""
            }), [N, { getFieldsValue: R }] = Z({
                schemas: S,
                showAdvancedButton: !1,
                labelWidth: "auto",
                gridProps: {
                    cols: 2,
                    xGap: 15
                }
            }), [_, { openModal: T, setProps: B, setSubLoading: w }] = ee({
                title: c("common.addText"),
                subBtuText: c("common.okText"),
                cancelText: c("common.cancelText"),
                width: 1e3
            });
            function u(t) {
                f.value[t ? "restReload" : "reload"]?.();
            }
            function A(t, e) {
                return $({
                    currentStatus: [
                        0,
                        2,
                        4
                    ],
                    ...t,
                    ...e,
                    subTypeIds: [
                        4,
                        5
                    ]
                });
            }
            async function M(t, e) {
                if (x.value = t, T(), e) {
                    v.value = e;
                    const p = await H({
                        templateCode: t,
                        uuid: r(v)
                    });
                    await k(), g.value?.setFieldsValue(p);
                }
            }
            async function q() {
                await k(), u();
            }
            async function O() {
                if (!o.value || !o.value.id) {
                    E.error(c("hsqe.auditInspection.vesselInspection.plannerHint")), w(!1);
                    return;
                }
                s.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_AddManagement",
                    query: {
                        id: o.value.id,
                        currentStatus: o.value.currentStatus,
                        shipName: o.value.shipName,
                        shipNameEn: o.value.shipNameEn,
                        shipId: o.value.shipId,
                        portName: o.value.portName
                    }
                });
            }
            function V(t, e) {
                o.value = e[0];
            }
            return a({
                showModal: M,
                setProps: B,
                getData: q
            }), (t, e)=>{
                const p = L;
                return J(), z(p, {
                    ref: "modalRef",
                    onRegister: r(_),
                    class: "basicModal basicFormModal",
                    onOnOk: O
                }, {
                    default: X(()=>[
                            h(r(W), {
                                ref_key: "contentFromRef",
                                ref: I,
                                onRegister: r(N),
                                onSubmit: e[0] || (e[0] = (l)=>u(!0)),
                                onReset: e[1] || (e[1] = (l)=>u(!0)),
                                class: "mb-3"
                            }, null, 8, [
                                "onRegister"
                            ]),
                            h(r(j), {
                                ref_key: "basicTableRef",
                                ref: f,
                                columns: r(D),
                                request: (l)=>A(l, r(R)()),
                                immediate: !1,
                                "row-key": (l)=>l.id,
                                "onUpdate:checkedRowKeys": V,
                                showTableSetting: !1
                            }, null, 8, [
                                "columns",
                                "request",
                                "row-key"
                            ])
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { Pe as default, __tla };
