import { V as b, bk as w, r as _, Z as p, ae as X, eB as Y, d as Z, e as j, b as G, a as U, cZ as J, aw as K, d9 as ee, c as S, o as k, w as n, j as r, W as te, l as c, cb as oe, H as se, aI as ne, p as ae, A as ie, aE as re, B as le, i as ce, X as pe, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as ue } from "./BasicForm-dL_oCSPM.js";
import { B as de } from "./Table-0PViRYCf.js";
import { _ as me } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { ax as _e, u as he, av as fe } from "./template-rpthWlT9.js";
import { u as ve } 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 "./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 nt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    w();
    const { t: d } = b();
    _([]);
    await _e();
    const be = [
        {
            key: 1,
            value: d("hsqe.rs.status.filling"),
            color: {
                color: "#F8F0FF",
                textColor: "#7A42C4",
                borderColor: "#F8F0FF"
            }
        },
        {
            key: 3,
            value: d("hsqe.rs.status.approval"),
            color: {
                color: "#F0F5FF",
                textColor: "#357CBB",
                borderColor: "#F0F5FF"
            }
        },
        {
            key: 4,
            value: d("hsqe.rs.status.completed"),
            color: {
                color: "#F0FFFB",
                textColor: "#42C4B2",
                borderColor: "#F0FFFB"
            }
        }
    ], ye = [
        {
            field: "year",
            label: d("hsqe.auditInspection.vesselInspection.year"),
            component: "NDatePicker",
            componentProps: {
                type: "year"
            }
        },
        {
            field: "status",
            label: d("hsqe.auditInspection.vesselInspection.reportStatus"),
            component: "NSelect",
            componentProps: {
                options: be,
                "value-field": "key",
                "label-field": "value"
            }
        }
    ], ge = w(), { t: s } = b(), x = [
        {
            key: 1,
            value: s("hsqe.rs.status.filling"),
            color: {
                color: "rgba(227,107,181,0.12)",
                textColor: "#E36BB5",
                borderColor: "rgba(227,107,181,0.5)"
            }
        },
        {
            key: 3,
            value: s("hsqe.rs.status.approval"),
            color: {
                color: "rgba(29,204,183,0.12)",
                textColor: "#1DCCB7",
                borderColor: "rgba(29,204,183,0.5)"
            }
        },
        {
            key: 4,
            value: s("hsqe.rs.status.completed"),
            color: {
                color: "rgba(63,195,63,0.12)",
                textColor: "#3FC33F",
                borderColor: "rgba(63,195,63,0.5)"
            }
        }
    ];
    function Ce() {
        const h = _(), l = _();
        return {
            columns: [
                {
                    title: s("hsqe.planner.no"),
                    key: "",
                    width: 60,
                    render (t, i) {
                        return (h.value - 1) * l.value + i + 1;
                    }
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.vessel"),
                    key: ge.getLocale === "en" ? "shipNameEn" : "shipName",
                    width: 140
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.reportNum"),
                    key: "reportNum",
                    width: 140
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.inspectionPort"),
                    key: "port",
                    width: 140
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.reportDate"),
                    key: "reportDate",
                    width: 140
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.reporter"),
                    key: "reportBy",
                    width: 140
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.reportStatus"),
                    key: "status",
                    width: 180,
                    render (t) {
                        return p(X, {
                            color: x.find((i)=>i.key === t.approveStatus)?.color
                        }, {
                            default: ()=>x.find((i)=>i.key === t.approveStatus)?.value
                        });
                    }
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.Process"),
                    key: "closedPercentage",
                    width: 140,
                    ellipsis: !1,
                    render (t) {
                        return p(Y, {
                            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, l.value = t.pageSize;
                }
            }
        };
    }
    nt = Z({
        __name: "index",
        setup (h) {
            const l = j(), { t: a } = b(), y = G(), t = J(), { columns: i, methods: I } = Ce(), { setPage: B } = I, [q, { getFieldsValue: g }] = ve({
                schemas: ye,
                labelWidth: "60px",
                gridProps: {
                    cols: 6,
                    xGap: 15
                },
                showAdvancedButton: !1
            }), N = U({
                width: 180,
                title: a("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    let o = y.info.roles;
                    return console.log("roles", o), p(me, {
                        style: "text",
                        actions: [
                            {
                                label: a("common.optionsViewText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: E.bind(this, e)
                            },
                            {
                                label: a("common.optionsEditText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-a-Frame28 text-[20px]"
                                }),
                                onClick: T.bind(this, e),
                                ifShow: e.updateEnable == 1 && e.approveStatus == 1
                            },
                            {
                                label: a("common.optionsReceiveText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-Send1 text-[21px]"
                                }),
                                onClick: R.bind(this, e),
                                ifShow: e.approveStatus === 2 && o.indexOf("marine_superintendent") !== -1
                            }
                        ]
                    });
                }
            }), f = _();
            function P() {
                l.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_addPSC"
                });
            }
            async function R(e) {
                try {
                    let o = {
                        uuid: e.uuid,
                        template_code: "pscReport",
                        approveFlag: "receive"
                    };
                    await he(o), t.success(a("common.disablePop.success")), v();
                } catch  {
                    return;
                }
            }
            function A() {
                v();
            }
            function D() {
                f.value.reload();
            }
            function E(e) {
                l.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_addPSC",
                    query: {
                        uuid: e.uuid,
                        type: "view",
                        shipName: e.shipName
                    }
                });
            }
            function T(e) {
                l.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_addPSC",
                    query: {
                        uuid: e.uuid,
                        type: "edit",
                        shipName: e.shipName
                    }
                });
            }
            function v() {
                f.value.reload();
            }
            async function V(e, o) {
                B(e);
                const m = g().year;
                return m && (o.year = new Date(m).getFullYear().toString()), await fe({
                    templateCode: "pscReport",
                    ...e,
                    ...o
                });
            }
            async function L() {
                v();
            }
            return K(()=>{
                L();
            }), (e, o)=>{
                const m = oe, O = ue, C = te, $ = le, H = ne, W = se, z = pe, Q = ee("permission");
                return k(), S(z, null, {
                    default: n(()=>[
                            r(C, {
                                bordered: !1,
                                class: "mb-2 proCard"
                            }, {
                                default: n(()=>[
                                        r(O, {
                                            onRegister: c(q),
                                            onSubmit: A,
                                            onReset: D
                                        }, {
                                            yearSlot: n(({ model: u, field: M })=>[
                                                    r(m, {
                                                        type: "year",
                                                        clearable: "",
                                                        "on-update:value": (F)=>{
                                                            u[M] = F ? new Date(F).getFullYear().toString() : null;
                                                        }
                                                    }, null, 8, [
                                                        "on-update:value"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            r(C, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: n(()=>[
                                        r(c(de), {
                                            ref_key: "basicTableRef",
                                            ref: f,
                                            columns: c(i),
                                            request: (u)=>V(u, c(g)()),
                                            immediate: !1,
                                            "row-key": (u)=>u.id,
                                            actionColumn: c(N),
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, {
                                            toolbar: n(()=>[
                                                    r(W, null, {
                                                        default: n(()=>[
                                                                r(H, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: n(()=>[
                                                                            re((k(), S($, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: P
                                                                            }, {
                                                                                icon: n(()=>o[0] || (o[0] = [
                                                                                        ce("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })), [
                                                                                [
                                                                                    Q,
                                                                                    {
                                                                                        action: [
                                                                                            "hsqe:pscReport:add"
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            ])
                                                                        ]),
                                                                    default: n(()=>[
                                                                            ae(" " + ie(c(a)("common.optionsAddText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { nt as default, __tla };
