import { d as y, V as C, r as p, a as g, Z as n, gE as l, ay as x, ac as J, cZ as v, c as D, o as S, w as d, j as m, l as t, c6 as A, X as R, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as B, __tla as __tla_1 } from "./AddAttachmentModal.vue_vue_type_script_setup_true_lang-BFar-2Ju.js";
import { B as V } from "./Table-0PViRYCf.js";
import { _ as E } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { c as M } from "./columns-BV6QS8Hv.js";
import { n as N, o as I } from "./vesselEquipmentDetails-CJeqdW1Z.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./BasicForm-dL_oCSPM.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 { __tla as __tla_2 } from "./schemas-Dz7LnyWK.js";
import "./schemas-Cam1kIsU.js";
import "./template-rpthWlT9.js";
import "./account-C850CBTF.js";
import "./useModal-CO65vga3.js";
import "./useForm-CKmgcynv.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 "./useTimeout-BxFilWvD.js";
import "./Flex-CTSf12gq.js";
import "./index-DatBjkM3.js";
import "./columns-BK5KZ8kW.js";
import "./dateUtil-BtafrT1f.js";
let Ae;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    Ae = y({
        __name: "Attachment",
        props: {
            selectedJobPlanParams: {},
            isEditable: {
                type: Boolean
            }
        },
        setup (f) {
            const a = f, { t: o } = C(), r = v(), s = p(), c = p(), { attachmentColumns: u } = M(), b = g({
                width: 200,
                title: o("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return n(E, {
                        style: "text",
                        actions: [
                            {
                                label: o("common.optionsViewText"),
                                labelShow: !1,
                                icon: n(l, {
                                    iconName: "view",
                                    iconType: "lineIcon"
                                }),
                                onClick: T.bind(null, e)
                            },
                            {
                                label: o("common.optionsDelText"),
                                labelShow: !1,
                                icon: n(l, {
                                    iconName: "delete",
                                    iconType: "lineIcon"
                                }),
                                isConfirm: !0,
                                confirmContent: o("common.dialogContentDeleteText"),
                                onPositiveClick: ()=>{
                                    w(e);
                                },
                                ifShow: ()=>a.isEditable
                            }
                        ]
                    });
                }
            });
            x(()=>a.selectedJobPlanParams, (e)=>{
                e && i();
            }, {
                immediate: !0,
                deep: !0
            });
            function _() {
                s.value?.handleOpenModal(o("common.addText"));
            }
            async function h() {
                return {
                    list: await I(a.selectedJobPlanParams)
                };
            }
            function i() {
                J(()=>{
                    c.value?.reload();
                });
            }
            function T(e) {
                e.fileUrl ? window.open(e.fileUrl, "_blank") : r.error("View failed");
            }
            async function w(e) {
                await N(e), r.success(o("common.optionsDelSuccessText")), i();
            }
            return (e, $)=>{
                const P = R;
                return S(), D(P, null, {
                    default: d(()=>[
                            m(t(V), {
                                ref_key: "basicTableRef",
                                ref: c,
                                columns: t(u),
                                request: h,
                                "row-key": (k)=>k.id,
                                immediate: !1,
                                autoScrollX: !0,
                                pagination: !1,
                                actionColumn: t(b),
                                canResize: !1,
                                "virtual-scroll": ""
                            }, A({
                                _: 2
                            }, [
                                e.isEditable ? {
                                    name: "toolbar",
                                    fn: d(()=>[
                                            m(t(l), {
                                                iconName: "add",
                                                onClick: _
                                            })
                                        ]),
                                    key: "0"
                                } : void 0
                            ]), 1032, [
                                "columns",
                                "row-key",
                                "actionColumn"
                            ]),
                            m(B, {
                                ref_key: "addAttachmentModalRef",
                                ref: s,
                                selectedJobPlanParams: e.selectedJobPlanParams,
                                onSuccess: i
                            }, null, 8, [
                                "selectedJobPlanParams"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Ae as default, __tla };
