import { V as y, r as f, bk as O, Z as m, ae as $, d as M, e as j, b as H, a as C, gE as v, aw as W, d9 as z, c as Q, o as U, w as d, j as a, W as X, l as s, aE as G, X as Z, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as J } from "./BasicForm-dL_oCSPM.js";
import { _ as K, __tla as __tla_1 } from "./Modal.vue_vue_type_script_setup_true_lang-CXKyxUcQ.js";
import { B as Y } from "./Table-0PViRYCf.js";
import { _ as tt } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { g as et } from "./navigationAudit-BE8ZxDH9.js";
import { u as ot } from "./useForm-CKmgcynv.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 "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./template-rpthWlT9.js";
import "./useModal-CO65vga3.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 "./usePageCache-DluHn7Yy.js";
import "./Flex-CTSf12gq.js";
let zt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: l } = y(), nt = [
        {
            key: 0,
            value: l("hsqe.auditInspection.navigationAudit.statusList.inProgress"),
            color: {
                color: "#F8F0FF",
                textColor: "#7A42C4",
                borderColor: "#F8F0FF"
            }
        },
        {
            key: 3,
            value: l("hsqe.auditInspection.navigationAudit.statusList.complete"),
            color: {
                color: "#FFF0F0",
                textColor: "#C35355",
                borderColor: "#FFF0F0"
            }
        }
    ];
    function it() {
        return {
            schemas: [
                {
                    field: "status",
                    component: "NSelect",
                    label: l("hsqe.auditInspection.navigationAudit.formStatus"),
                    componentProps: {
                        placeholder: l("hsqe.auditInspection.navigationAudit.formVesselHint"),
                        options: nt,
                        "value-field": "key",
                        "label-field": "value"
                    }
                },
                {
                    label: l("hsqe.auditInspection.navigationAudit.formInspectionDate"),
                    field: "inspectionDate",
                    component: "NDatePicker",
                    componentProps: ()=>({
                            type: "daterange",
                            valueFormat: "yyyy-MM-dd"
                        })
                }
            ]
        };
    }
    const st = O(), { t: n } = y(), A = [
        {
            key: 0,
            value: n("hsqe.auditInspection.navigationAudit.statusList.inProgress"),
            color: {
                color: "rgba(23,182,235,0.12)",
                textColor: "#17B6EB",
                borderColor: "rgba(23,182,235,0.5)"
            }
        },
        {
            key: 3,
            value: n("hsqe.auditInspection.navigationAudit.statusList.complete"),
            color: {
                color: "rgba(63,195,63,0.12)",
                textColor: "#3FC33F",
                borderColor: "rgba(63,195,63,0.5)"
            }
        }
    ];
    function at() {
        const r = f(), i = f();
        return {
            columns: [
                {
                    title: n("hsqe.planner.no"),
                    key: "",
                    width: 60,
                    render (e, o) {
                        return (r.value - 1) * i.value + o + 1;
                    }
                },
                {
                    title: n("hsqe.auditInspection.navigationAudit.reportNo"),
                    key: "reportNo",
                    width: 120
                },
                {
                    title: n("hsqe.auditInspection.navigationAudit.vessel"),
                    key: st.getLocale === "en" ? "shipNameEn" : "shipName",
                    width: 120
                },
                {
                    title: n("hsqe.auditInspection.vesselInspection.deficiency.createTime"),
                    key: "raisedOn",
                    width: 120
                },
                {
                    title: n("hsqe.auditInspection.navigationAudit.dateOfInspection"),
                    key: "inspectionDate",
                    width: 120
                },
                {
                    title: n("hsqe.auditInspection.vesselInspection.deficiency.createByName"),
                    key: "createByName",
                    width: 120
                },
                {
                    title: n("hsqe.auditInspection.navigationAudit.status"),
                    key: "status",
                    width: 100,
                    render (e) {
                        return m($, {
                            color: A.find((o)=>o.key === e.status)?.color
                        }, {
                            default: ()=>A.find((o)=>o.key === e.status)?.value
                        });
                    }
                }
            ],
            methods: {
                setPage: (e)=>{
                    r.value = e.pageNum, i.value = e.pageSize;
                }
            }
        };
    }
    zt = M({
        __name: "index",
        props: {
            currentComponent: String
        },
        setup (r) {
            const i = r, h = j(), b = H(), { t: e } = y(), o = f(), I = f(), { columns: F, methods: w } = at(), { schemas: S } = it(), { setPage: q } = w, [N, { getFieldsValue: T }] = ot({
                schemas: S,
                gridProps: {
                    cols: 5,
                    xGap: 15
                },
                showAdvancedButton: !1
            }), x = C({
                width: 140,
                title: e("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (t) {
                    return m(tt, {
                        style: "text",
                        actions: [
                            {
                                label: e("common.optionsViewText"),
                                labelShow: !1,
                                icon: m(v, {
                                    iconName: "view",
                                    iconType: "lineIcon"
                                }),
                                onClick: D.bind(this, t)
                            },
                            {
                                label: e("common.optionsEditText"),
                                labelShow: !1,
                                icon: m(v, {
                                    iconName: "edit",
                                    iconType: "lineIcon"
                                }),
                                onClick: R.bind(this, t),
                                ifShow: ()=>(t.status == 0 || t.status == 2) && b.getUserInfo?.id == t.createBy
                            }
                        ]
                    });
                }
            });
            function u(t) {
                return {
                    navigationAudit: 1,
                    mooringAudit: 4,
                    cargoAudit: 0,
                    Bunkering: 3,
                    engineeringAudit: 2
                }[t];
            }
            function B() {
                o.value?.showModal(u(i.currentComponent), null, null), o.value.getData(null);
            }
            function D(t) {
                h.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_AddNavigationAudit",
                    query: {
                        uuid: t.uuid,
                        type: "view",
                        currentType: u(i.currentComponent),
                        id: t.id,
                        plannerId: t.plannerId
                    }
                });
            }
            function R(t) {
                h.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_AddNavigationAudit",
                    query: {
                        uuid: t.uuid,
                        type: "edit",
                        currentType: u(i.currentComponent),
                        id: t.id,
                        plannerId: t.plannerId
                    }
                });
            }
            function p() {
                I.value.reload();
            }
            function P(t, c) {
                q(t);
                const g = C({
                    status: c.status,
                    inspectionStartDate: c.inspectionDate?.[0],
                    inspectionEndDate: c.inspectionDate?.[1],
                    type: u(i.currentComponent)
                });
                return et({
                    ...t,
                    ...g
                });
            }
            function E() {
                p();
            }
            return W(()=>{
                E();
            }), (t, c)=>{
                const g = J, k = X, L = Z, V = z("permission");
                return U(), Q(L, null, {
                    default: d(()=>[
                            a(k, {
                                class: "mb-2 proCard"
                            }, {
                                default: d(()=>[
                                        a(g, {
                                            onRegister: s(N),
                                            onSubmit: p,
                                            onReset: p
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(k, {
                                class: "proCard"
                            }, {
                                default: d(()=>[
                                        a(s(Y), {
                                            ref_key: "basicTableRef",
                                            ref: I,
                                            columns: s(F),
                                            request: (_)=>P(_, s(T)()),
                                            immediate: !1,
                                            "row-key": (_)=>_.id,
                                            actionColumn: s(x),
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, {
                                            toolbar: d(()=>[
                                                    G(a(s(v), {
                                                        tooltip: s(e)("common.addText"),
                                                        iconName: "add",
                                                        onClick: B
                                                    }, null, 8, [
                                                        "tooltip"
                                                    ]), [
                                                        [
                                                            V,
                                                            {
                                                                action: [
                                                                    "hsqe:navigationReport:add"
                                                                ]
                                                            }
                                                        ]
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(K, {
                                ref_key: "modalRef",
                                ref: o,
                                onSuccess: p
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { zt as default, __tla };
