import { _ as q } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { B as x } from "./Table-0PViRYCf.js";
import { d as L, V as J, r as m, c as O, o as K, l as e, w as V, j as u, ac as $, cZ as j, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as A } from "./BasicForm-dL_oCSPM.js";
import { u as D } from "./useForm-CKmgcynv.js";
import { c as I } from "./columns-BV6QS8Hv.js";
import { c as N, __tla as __tla_1 } from "./schemas-Dz7LnyWK.js";
import { B as W, C as X } from "./vesselEquipmentDetails-CJeqdW1Z.js";
import { u as Z } from "./useModal-CO65vga3.js";
let ae;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    ae = L({
        __name: "SelectSMSFormsModal",
        props: {
            selectedJobPlanParams: {}
        },
        emits: [
            "success"
        ],
        setup (d, { expose: f, emit: p }) {
            const b = d, h = p, c = j(), { t: n } = J(), i = m(), t = m([]), { smsModalColumns: g } = I(), { smsFormsModalSearchSchemas: R } = N(), [S, { openModal: M, closeModal: C, setSubLoading: r, setProps: y }] = Z({
                title: "",
                width: 1200
            }), [T, { getFieldsValue: k }] = D({
                gridProps: {
                    cols: 4
                },
                schemas: R,
                labelWidth: "auto",
                labelPlacement: "top",
                showAdvancedButton: !1
            });
            function w(s, o) {
                return W({
                    ...s,
                    ...o
                });
            }
            function _() {
                y({
                    title: n("equipmentLibrary.equipmentMainLibrary.selectTitle")
                }), M(), $(()=>{
                    l();
                });
            }
            function l(s) {
                i.value.restReload();
            }
            function P(s) {
                t.value = e(s);
            }
            async function v() {
                if (!t.value?.length) {
                    c.error(n("equipmentLibrary.equipmentMainLibrary.job.selectTips")), r(!1);
                    return;
                }
                try {
                    await X({
                        smsCodeList: e(t),
                        ...b.selectedJobPlanParams || {}
                    }), c.success(n("common.optionsAddSuccessText")), C(), r(!1), h("success");
                } catch  {
                    r(!1);
                }
            }
            function B() {
                t.value = [];
            }
            return f({
                handleOpenModal: _
            }), (s, o)=>{
                const F = q;
                return K(), O(F, {
                    ref: "modalRef",
                    onRegister: e(S),
                    onOnOk: v,
                    onOnClose: B
                }, {
                    default: V(()=>[
                            u(e(A), {
                                onRegister: e(T),
                                onSubmit: o[0] || (o[0] = (a)=>l(!0)),
                                onReset: o[1] || (o[1] = (a)=>l(!0))
                            }, null, 8, [
                                "onRegister"
                            ]),
                            u(e(x), {
                                ref_key: "basicTableRef",
                                ref: i,
                                columns: e(g),
                                request: (a)=>w(a, e(k)()),
                                "row-key": (a)=>a.code,
                                immediate: !1,
                                autoScrollX: "",
                                virtualScroll: "",
                                isKeepRowKeys: "",
                                onCheckedRowChange: P
                            }, null, 8, [
                                "columns",
                                "request",
                                "row-key"
                            ])
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { ae as _, __tla };
