import { V as y, r as d, bk as T, Z as p, ae as D, eB as V, d as L, e as O, a as W, aw as $, c as z, o as H, w as m, j as n, W as Q, l, cb as X, X as Y, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as j } from "./BasicForm-dL_oCSPM.js";
import { B as G } from "./Table-0PViRYCf.js";
import { _ as M } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { u as Z } from "./useForm-CKmgcynv.js";
import { av as J, ay as K } from "./template-rpthWlT9.js";
import { _ as U, __tla as __tla_1 } from "./Modal.vue_vue_type_script_setup_true_lang-BWzSPHvu.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 $e;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: ee } = y(), te = [
        {
            field: "year",
            label: ee("hsqe.auditInspection.vesselInspection.year"),
            component: "NDatePicker",
            componentProps: {
                type: "year"
            }
        }
    ], oe = T(), { t: o } = y(), w = [
        {
            key: 1,
            value: o("hsqe.rs.status.filling"),
            color: {
                color: "rgba(227,107,181,0.12)",
                textColor: "#E36BB5",
                borderColor: "rgba(227,107,181,0.5)"
            }
        },
        {
            key: 3,
            value: o("hsqe.rs.status.approval"),
            color: {
                color: "rgba(29,204,183,0.12)",
                textColor: "#1DCCB7",
                borderColor: "rgba(29,204,183,0.5)"
            }
        },
        {
            key: 4,
            value: o("hsqe.rs.status.completed"),
            color: {
                color: "rgba(63,195,63,0.12)",
                textColor: "#3FC33F",
                borderColor: "rgba(63,195,63,0.5)"
            }
        }
    ];
    function se() {
        const h = d(), r = d();
        return {
            columns: [
                {
                    title: o("hsqe.planner.no"),
                    key: "",
                    width: 60,
                    render (t, s) {
                        return (h.value - 1) * r.value + s + 1;
                    }
                },
                {
                    title: o("hsqe.auditInspection.vesselInspection.vessel"),
                    key: oe.getLocale === "en" ? "shipNameEn" : "shipName",
                    width: 140
                },
                {
                    title: o("hsqe.auditInspection.vesselInspection.reportNum"),
                    key: "reportNum",
                    width: 140
                },
                {
                    title: o("hsqe.auditInspection.vesselInspection.reportDate"),
                    key: "raisedOn",
                    width: 140
                },
                {
                    title: o("hsqe.auditInspection.vesselInspection.reporter"),
                    key: "reportBy",
                    width: 140
                },
                {
                    title: o("hsqe.auditInspection.vesselInspection.reportStatus"),
                    key: "status",
                    width: 180,
                    render (t) {
                        return p(D, {
                            color: w.find((s)=>s.key === t.approveStatus)?.color
                        }, {
                            default: ()=>w.find((s)=>s.key === t.approveStatus)?.value
                        });
                    }
                },
                {
                    title: o("hsqe.auditInspection.vesselInspection.Process"),
                    key: "closedPercentage",
                    width: 140,
                    ellipsis: !1,
                    render (t) {
                        return p(V, {
                            type: "line",
                            percentage: t.approveStatus === 4 ? 100 : Number(t.closedPercentage),
                            style: {
                                width: "100%"
                            },
                            color: "#0EC06A",
                            railColor: "#E8FBEE",
                            indicatorTextColor: "#0EC06A"
                        });
                    }
                }
            ],
            methods: {
                setPage: (t)=>{
                    h.value = t.pageNum, r.value = t.pageSize;
                }
            }
        };
    }
    $e = L({
        __name: "index",
        setup (h) {
            const r = O(), { t: c } = y(), { columns: b, methods: t } = se(), { setPage: s } = t, [C, { getFieldsValue: g }] = Z({
                schemas: te,
                labelWidth: "60px",
                gridProps: {
                    cols: 6,
                    xGap: 15
                },
                showAdvancedButton: !1
            }), S = W({
                width: 180,
                title: c("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return p(M, {
                        style: "text",
                        actions: [
                            {
                                label: c("common.optionsViewText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: E.bind(this, e)
                            },
                            {
                                label: c("common.optionsEditText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-a-Frame28 text-[20px]"
                                }),
                                onClick: N.bind(this, e),
                                ifShow: e.updateEnable == 1 && e.approveStatus == 1
                            }
                        ]
                    });
                }
            }), _ = d(), x = d("");
            function I() {
                f();
            }
            function q() {
                _.value.reload();
            }
            function E(e) {
                r.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_AddRS",
                    query: {
                        uuid: e.uuid,
                        type: "view",
                        shipName: e.shipName
                    }
                });
            }
            function N(e) {
                r.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_AddRS",
                    query: {
                        uuid: e.uuid,
                        type: "edit",
                        shipName: e.shipName
                    }
                });
            }
            function f() {
                _.value.reload();
            }
            async function R(e, a) {
                s(e);
                const u = g().year;
                return u && (a.year = new Date(u).getFullYear().toString()), await J({
                    templateCode: "rightshipReport",
                    ...e,
                    ...a
                });
            }
            async function B() {
                let a = await K({
                    templateCode: "rightshipReport"
                });
                x.value = a ? a.addEnable : "", console.log(a), f();
            }
            return $(()=>{
                B();
            }), (e, a)=>{
                const u = X, A = j, v = Q, F = Y;
                return H(), z(F, null, {
                    default: m(()=>[
                            n(v, {
                                bordered: !1,
                                class: "mb-2 proCard"
                            }, {
                                default: m(()=>[
                                        n(A, {
                                            onRegister: l(C),
                                            onSubmit: I,
                                            onReset: q
                                        }, {
                                            yearSlot: m(({ model: i, field: P })=>[
                                                    n(u, {
                                                        type: "year",
                                                        clearable: "",
                                                        "on-update:value": (k)=>{
                                                            i[P] = k ? new Date(k).getFullYear().toString() : null;
                                                        }
                                                    }, null, 8, [
                                                        "on-update:value"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            n(v, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: m(()=>[
                                        n(l(G), {
                                            ref_key: "basicTableRef",
                                            ref: _,
                                            columns: l(b),
                                            request: (i)=>R(i, l(g)()),
                                            immediate: !1,
                                            "row-key": (i)=>i.id,
                                            actionColumn: l(S),
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, null, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            n(U, {
                                ref: "modalRef",
                                onSuccess: f
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { $e as default, __tla };
