import { V as v, bk as T, Z as a, ae as Q, d as Z, b as z, e as O, f as G, r as b, a as J, aw as Y, c as x, o as N, w as i, j as c, W as ee, l as r, k as te, H as oe, D as ie, aI as se, p as ne, A as ae, B as ce, i as re, X as le, ac as pe, cZ as de, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as ue } from "./BasicForm-dL_oCSPM.js";
import { u as me } from "./useForm-CKmgcynv.js";
import { X as fe, i as ye, af as he, j as _e, ag as ge, R as be, ah as ve, ai as Se } from "./template-rpthWlT9.js";
import { f as qe } from "./workpermit-ycq2YJDA.js";
import { B as Ce } from "./Table-0PViRYCf.js";
import { _ as we } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { u as Re } from "./useSearchParam-B08ob60x.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 "./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 "./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 "./Flex-CTSf12gq.js";
let _t;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let f, o, ke, xe, Ne, Te, De, Le, s, u, Fe;
    f = T();
    ({ t: o } = v());
    ke = await fe();
    xe = await ye();
    Ne = await he();
    Te = await ge();
    De = await _e();
    Le = [
        {
            field: "shipId",
            component: "NSelect",
            label: o("hsqe.deficiency.vessel"),
            componentProps: {
                placeholder: o("hsqe.auditInspection.vesselInspection.formVesselHint"),
                options: ke,
                "label-field": f.getLocale === "en" ? "shipNameEn" : "shipName",
                "value-field": "id"
            }
        },
        {
            field: "severity",
            component: "NSelect",
            label: o("hsqe.deficiency.servity"),
            componentProps: {
                placeholder: o("hsqe.deficiency.servity"),
                options: xe,
                "label-field": f.getLocale === "en" ? "labelEn" : "label"
            }
        },
        {
            field: "reportType",
            component: "NSelect",
            label: o("hsqe.deficiency.source"),
            componentProps: {
                placeholder: o("hsqe.deficiency.source"),
                options: Ne,
                "label-field": f.getLocale === "en" ? "labelEn" : "label"
            }
        },
        {
            field: "reportNo",
            component: "NInput",
            label: o("hsqe.deficiency.reportNo"),
            defaultValue: "",
            componentProps: {
                placeholder: o("hsqe.deficiency.reportNoHint")
            }
        },
        {
            field: "officePositionCode",
            component: "NSelect",
            label: o("hsqe.deficiency.officeResponsiblePerson"),
            componentProps: {
                options: De,
                "label-field": f.getLocale === "en" ? "nameEn" : "name",
                "value-field": "code"
            }
        },
        {
            field: "status",
            component: "NSelect",
            label: o("hsqe.deficiency.status"),
            componentProps: {
                placeholder: o("hsqe.auditInspection.vesselInspection.formReportStatusHint"),
                options: Te,
                "label-field": f.getLocale === "en" ? "labelEn" : "label"
            }
        },
        {
            field: "queryDateList",
            label: o("hsqe.deficiency.expiryDate"),
            component: "NDatePicker",
            componentProps: {
                type: "daterange",
                valueFormat: "yyyy-MM-dd"
            }
        }
    ];
    ({ t: s } = v());
    u = T();
    Fe = [
        {
            type: "selection",
            key: "selection",
            width: 60
        },
        {
            title: s("hsqe.question.serialNo"),
            key: "index",
            width: 80,
            render (e, l) {
                return l + 1;
            }
        },
        {
            title: s("hsqe.deficiency.vessel"),
            key: u.getLocale === "en" ? "shipNameEn" : "shipName",
            width: 140
        },
        {
            title: s("hsqe.deficiency.deficiencyCode"),
            key: "deficiencyCode",
            width: 140,
            render (e) {
                return a("span", {}, {
                    default: ()=>u.getLocale === "en" ? e.dispDeficiencyCodeEn : e.dispDeficiencyCode
                });
            }
        },
        {
            title: s("hsqe.deficiency.servity"),
            key: "severity",
            width: 140,
            render (e) {
                return a("span", {}, {
                    default: ()=>u.getLocale === "en" ? e.dispSeverityEn : e.dispSeverity
                });
            }
        },
        {
            title: s("hsqe.deficiency.expiryDate"),
            key: "expirationTime",
            width: 140,
            render (e) {
                return qe(new Date(e.expirationTime));
            }
        },
        {
            title: s("hsqe.deficiency.PIC"),
            key: "vesselPositionName",
            width: 140,
            render (e) {
                return a("span", {}, {
                    default: ()=>u.getLocale === "en" ? e.vesselPositionNameEn : e.vesselPositionName
                });
            }
        },
        {
            title: s("hsqe.deficiency.source"),
            key: "dispReportType",
            width: 140,
            render (e) {
                return a("span", {}, {
                    default: ()=>u.getLocale === "en" ? e.dispReportTypeEn : e.dispReportType
                });
            }
        },
        {
            title: s("hsqe.deficiency.reportNo"),
            key: "reportNo",
            width: 140
        },
        {
            title: s("hsqe.deficiency.status"),
            key: "dispStatus",
            width: 140,
            render (e) {
                const l = new Date(e.expirationTime).getTime() - new Date().getTime(), m = Math.ceil(l / (1e3 * 60 * 60 * 24));
                return a(Q, {
                    type: "success",
                    bordered: !0,
                    color: e.status !== "closed" && m < 0 ? {
                        color: "#FFF0F0",
                        textColor: "#E06C63",
                        borderColor: "rgba(255,170,171,0.5)"
                    } : e.status !== "closed" && m < 3 ? {
                        color: "#FCFFF0",
                        textColor: "#CF8F04",
                        borderColor: "rgba(228,175,100,0.5)"
                    } : {}
                }, {
                    default: ()=>u.getLocale === "en" ? e.dispStatusEnglish : e.dispStatus
                });
            }
        }
    ];
    _t = Z({
        __name: "index",
        setup (e) {
            const l = z(), m = O(), y = G(), { t: p } = v(), S = b(), q = de(), h = b([]), C = b(!1), _ = b({}), [D, { getFieldsValue: w, setFieldsValue: L }] = me({
                schemas: Le,
                gridProps: {
                    cols: 6
                }
            }), { restoreSearchParams: F } = Re(w, L), P = J({
                width: 120,
                title: p("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (t) {
                    return a(we, {
                        style: "text",
                        actions: [
                            {
                                label: p("hsqe.deficiency.view"),
                                labelShow: !1,
                                icon: a("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: ()=>{
                                    m.push({
                                        name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_DeficiencyReport",
                                        query: {
                                            id: t.id,
                                            type: "view"
                                        }
                                    });
                                }
                            },
                            {
                                label: p("common.optionsEditText"),
                                labelShow: !1,
                                icon: a("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: ()=>{
                                    m.push({
                                        name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_DeficiencyReport",
                                        query: {
                                            id: t.id,
                                            isEdit: 1
                                        }
                                    });
                                },
                                ifShow: ()=>t.editable
                            }
                        ]
                    });
                }
            });
            async function E() {
                y.query?.expirationWarningStatus && (_.value.expirationWarningStatus = y.query?.expirationWarningStatus), y.query?.status && (_.value.completeStatus = y.query?.status), await pe(), g();
                const t = l.getUserInfo.id, n = await be(t);
                C.value = n?.isCaptain == "1";
            }
            function I(t) {
                h.value = t;
            }
            async function V() {
                if (h.value && h.value.length === 0) {
                    q.warning(p("hsqe.rightShip.unselectRowText"));
                    return;
                } else await ve(h.value), q.success(p("hsqe.deficiency.operationSuccessful")), g();
            }
            function g() {
                S.value.restReload();
            }
            function A(t) {
                g();
            }
            function B(t) {
                g();
            }
            async function H(t) {
                let n = F();
                return n || (n = w()), Se({
                    ...t,
                    ...n,
                    ..._.value
                });
            }
            function W() {
                _.value = {};
            }
            return Y(()=>{
                E();
            }), (t, n)=>{
                const M = te, R = ee, U = ce, $ = se, X = oe, j = le;
                return N(), x(j, null, {
                    default: i(()=>[
                            c(R, {
                                bordered: !1,
                                class: "mb-2 proCard"
                            }, {
                                default: i(()=>[
                                        c(r(ue), {
                                            onRegister: r(D),
                                            onSubmit: A,
                                            onReset: B
                                        }, {
                                            statusSlot: i(({ model: d, field: k })=>[
                                                    c(M, {
                                                        value: d[k],
                                                        "onUpdate:value": (K)=>d[k] = K
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            c(R, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: i(()=>[
                                        c(r(Ce), {
                                            columns: r(Fe),
                                            request: (d)=>H(d),
                                            "row-key": (d)=>d.id,
                                            ref_key: "basicTableRef",
                                            ref: S,
                                            autoScrollX: !0,
                                            immediate: !1,
                                            "virtual-scroll": "",
                                            actionColumn: r(P),
                                            "onUpdate:checkedRowKeys": I,
                                            onFetchSuccess: W
                                        }, {
                                            tableTitle: i(()=>[
                                                    c(X, null, {
                                                        default: i(()=>[
                                                                r(C) ? (N(), x($, {
                                                                    key: 0,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: i(()=>[
                                                                            c(U, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: V
                                                                            }, {
                                                                                icon: i(()=>n[0] || (n[0] = [
                                                                                        re("i", {
                                                                                            class: "iconfont icon-Approve text-[18px]"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: i(()=>[
                                                                            ne(" " + ae(r(p)("hsqe.deficiency.batch")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })) : ie("", !0)
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { _t as default, __tla };
