import { B as M } from "./Table-0PViRYCf.js";
import { _ as N } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { V as k, Z as c, bk as A, d as L, gF as _, gG as V, f as B, e as H, r as O, a4 as P, a as Q, gE as s, cZ as $, h as j, o as p, j as m, w, H as G, c as v, D as I, l as o, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as Z, __tla as __tla_1 } from "./Modal.vue_vue_type_script_setup_true_lang-CYV2iErC.js";
import { r as z } from "./template-rpthWlT9.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./componentMap-CElCaWis.js";
import "./propTypes-CebMRUpe.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 "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.js";
import "./BasicForm-dL_oCSPM.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./ImageUpload-DUsnro3W.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.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 "./useForm-CKmgcynv.js";
import { __tla as __tla_2 } from "./modalSchemas-JSdK1AGK.js";
import "./helper-Czt-QYps.js";
import "./memoize-C3Z21RQJ.js";
let Ve;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    const F = A(), { t: a } = k();
    function W() {
        return {
            columns: [
                {
                    title: a("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.no"),
                    key: "no",
                    width: 50,
                    render: (n, t)=>t + 1
                },
                {
                    title: a("hsqe.auditInspection.vesselInspection.deficiency.description"),
                    key: "desc",
                    width: 150
                },
                {
                    title: a("hsqe.auditInspection.vesselInspection.deficiency.pic"),
                    key: "owner",
                    width: 150,
                    render (n) {
                        return c("span", {}, {
                            default: ()=>F.getLocale === "en" ? n.ownerEn : n.owner
                        });
                    }
                },
                {
                    title: a("hsqe.auditInspection.vesselInspection.deficiency.dateRectify"),
                    key: "dueDate",
                    width: 150,
                    render: (n)=>n.dueDate.replace("T", " ")
                },
                {
                    title: a("hsqe.auditInspection.vesselInspection.deficiency.confirmation"),
                    key: "verifier",
                    width: 150
                }
            ]
        };
    }
    Ve = L({
        __name: "index",
        props: _({
            currentTab: {},
            readOnly: {
                type: Boolean
            }
        }, {
            dataInfo: {
                type: Object,
                default: ()=>({})
            },
            dataInfoModifiers: {}
        }),
        emits: _([
            "refreshDeficiency"
        ], [
            "update:dataInfo"
        ]),
        setup (u, { emit: n }) {
            const t = V(u, "dataInfo"), S = n, d = B(), f = $(), l = H(), { t: i } = k(), r = O(), h = P(()=>t.value.deficiencyList.filter((e)=>e.isMemo === "no")), { columns: b } = W(), x = Q({
                width: 100,
                title: i("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return c(N, {
                        style: "text",
                        actions: [
                            {
                                label: i("common.optionsViewText"),
                                labelShow: !1,
                                icon: c(s, {
                                    iconName: "view",
                                    iconType: "lineIcon"
                                }),
                                onClick: D.bind(this, e)
                            },
                            {
                                label: i("common.optionsEditText"),
                                labelShow: !1,
                                icon: c(s, {
                                    iconName: "edit",
                                    iconType: "lineIcon"
                                }),
                                onClick: C.bind(this, e),
                                ifShow: ()=>e.editable && d.query.type !== "view"
                            },
                            {
                                label: i("common.optionsDelText"),
                                labelShow: !1,
                                icon: c(s, {
                                    iconName: "delete",
                                    iconType: "lineIcon"
                                }),
                                onPositiveClick: ()=>T(e),
                                isConfirm: !0,
                                confirmContent: i("common.delPop.cont"),
                                ifShow: ()=>e.editable && d.query.type !== "view" && [
                                        1,
                                        2,
                                        4
                                    ].includes(+t.value?.approveStatus)
                            }
                        ]
                    });
                }
            });
            function y() {
                S("refreshDeficiency");
            }
            function g() {
                t.value.reportNum ? r.value?.showModal(t.value, {}, "add") : f.warning(i("hsqe.sire.cantAddHint"));
            }
            function C(e) {
                e.status == "new" ? r.value?.showModal(t.value, e, "edit") : l.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_DeficiencyReport",
                    query: {
                        id: e.id,
                        isEdit: 1,
                        status: e.status
                    }
                });
            }
            function D(e) {
                +t.value?.approveStatus == 5 ? l.push({
                    name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_DeficiencyReport",
                    query: {
                        id: e.id,
                        type: "view"
                    }
                }) : r.value?.showModal(t.value, e, "view");
            }
            async function T(e) {
                await z({
                    id: e.id
                }), f.success(i("common.delPop.success")), y();
            }
            function R() {
                const { href: e } = l.resolve({
                    name: "Add_HSQE_AuditInspection_ReportList_exportDeficiencyPdf",
                    query: {
                        uuid: t.value.uuid,
                        name: "ManagementInspection"
                    }
                });
                window.open(e, "_blank");
            }
            return (e, X)=>{
                const q = G;
                return p(), j("div", null, [
                    m(o(M), {
                        ref: "tableRef",
                        columns: o(b),
                        dataSource: o(h),
                        "row-key": (E)=>E.id,
                        pagination: !1,
                        autoScrollX: !0,
                        "virtual-scroll": "",
                        showTableSetting: !1,
                        actionColumn: o(x)
                    }, {
                        tableTitle: w(()=>[
                                m(q, {
                                    align: "center"
                                }, {
                                    default: w(()=>[
                                            o(h)?.length > 0 ? (p(), v(o(s), {
                                                key: "export",
                                                tooltip: o(i)("common.optionsExportListText"),
                                                iconSize: 23,
                                                iconName: "export",
                                                onClick: R
                                            }, null, 8, [
                                                "tooltip"
                                            ])) : I("", !0),
                                            e.readOnly ? I("", !0) : (p(), v(o(s), {
                                                key: 1,
                                                tooltip: o(i)("common.addText"),
                                                iconName: "add",
                                                onClick: g
                                            }, null, 8, [
                                                "tooltip"
                                            ]))
                                        ]),
                                    _: 1
                                })
                            ]),
                        _: 1
                    }, 8, [
                        "columns",
                        "dataSource",
                        "row-key",
                        "actionColumn"
                    ]),
                    m(Z, {
                        ref_key: "modalRef",
                        ref: r,
                        onSuccess: y
                    }, null, 512)
                ]);
            };
        }
    });
});
export { Ve as default, __tla };
