import { d as N, u as X, V as M, e as U, f as j, dc as z, r as y, a as v, Z as H, gW as c, gX as p, ay as Z, aw as G, d9 as J, c as d, o as u, w as i, j as r, W as K, x as O, ds as Q, l as n, h as Y, F as tt, a9 as et, y as ot, H as nt, aI as it, p as at, A as rt, aE as st, B as lt, ca as mt, X as ct, __tla as __tla_0 } from "./index-9PRMimni.js";
import { c as pt, g as ut } from "./training-DVATRQCh.js";
import { B as dt } from "./BasicForm-dL_oCSPM.js";
import { u as _t } from "./useForm-CKmgcynv.js";
import { s as ft, __tla as __tla_1 } from "./schemas-DF6duLaU.js";
import { i as gt, __tla as __tla_2 } from "./columns--0qKB6VJ.js";
import { B as bt } from "./Table-0PViRYCf.js";
import { _ as wt } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { d as ht } from "./download-CIBdrxiA.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 "./template-rpthWlT9.js";
import { __tla as __tla_3 } from "./schemas-DzvLPsci.js";
import "./isEmpty-BUg1OsQj.js";
import "./illnessInjury-CN3bQPcI.js";
import "./format-DgF6KtHk.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./componentMap-CElCaWis.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";
import "./base64Conver-4Xd-Hzyx.js";
let ue;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })()
]).then(async ()=>{
    let xt;
    xt = {
        name: "CrewTraining"
    };
    ue = N({
        ...xt,
        setup (yt) {
            const _ = X(), { t: a } = M(), f = U(), T = j(), { hasPermission: g } = z(), b = y(), s = y(4), C = [
                {
                    id: "otherTraining",
                    value: 4
                }
            ], { columns: D } = gt(), { schemas: k } = ft(), R = v({
                width: 200,
                title: a("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return H(wt, {
                        style: "text",
                        actions: [
                            {
                                label: a("common.optionsViewText"),
                                labelShow: !1,
                                ifShow: g([
                                    "crew:training:view"
                                ]),
                                icon: c(p.view, "text-[#3F7AE9] text-[18px]"),
                                onClick: w.bind(null, e, "view")
                            },
                            {
                                label: a("common.optionsEditText"),
                                labelShow: !1,
                                icon: c(p.edit),
                                ifShow: e.status === "1" && g([
                                    "crew:training:edit"
                                ]),
                                onClick: w.bind(null, e, "edit")
                            },
                            {
                                label: a("common.exportText"),
                                labelShow: !1,
                                ifShow: e.type === "2_1",
                                icon: c(p.export, "text-[#7A957D] text-[20px]"),
                                onClick: F.bind(null, e)
                            }
                        ]
                    });
                }
            }), [B, { getFieldsValue: S }] = _t({
                gridProps: {
                    cols: "2 s:3 m:4 l:5 xl:6"
                },
                schemas: k,
                labelWidth: "auto",
                labelPlacement: "top",
                showAdvancedButton: !0
            });
            async function A(e, t) {
                const m = v({
                    trainingDateStart: t.trainingDate?.[0],
                    trainingDateEnd: t.trainingDate?.[1],
                    ...t
                });
                return delete m.trainingDate, ut({
                    ...e,
                    ...m,
                    category: s.value
                });
            }
            async function F(e) {
                try {
                    const t = await pt(Number(e?.id), s.value);
                    ht({
                        url: t
                    }), _.success(a("common.exportSuccess"));
                } catch (t) {
                    console.error("导出失败", t), _.error(a("common.exportFail"));
                }
            }
            function l() {
                b.value?.restReload();
            }
            Z(()=>T.path, (e, t)=>{
                e.includes("/crew/crewTraining") && l();
            });
            function E() {
                return f.push({
                    name: "otherTrainingAdd",
                    query: {
                        type: "add"
                    }
                });
            }
            function w(e, t) {
                return f.push({
                    name: "otherTrainingAdd",
                    query: {
                        id: e.id,
                        type: t
                    }
                });
            }
            function P(e) {
                l();
            }
            function V() {
                l();
            }
            return G(()=>{
                V();
            }), (e, t)=>{
                const m = ot, h = O, x = K, q = lt, I = it, L = nt, W = ct, $ = J("permission");
                return u(), d(W, null, {
                    default: i(()=>[
                            r(x, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: i(()=>[
                                        r(h, {
                                            value: n(s),
                                            "onUpdate:value": [
                                                t[0] || (t[0] = (o)=>Q(s) ? s.value = o : null),
                                                t[1] || (t[1] = (o)=>P(o))
                                            ],
                                            type: "line"
                                        }, {
                                            default: i(()=>[
                                                    (u(), Y(tt, null, et(C, (o)=>r(m, {
                                                            key: o.value,
                                                            name: o.value,
                                                            tab: n(a)(`crewTraining.${o.id}`),
                                                            "display-directive": "show"
                                                        }, null, 8, [
                                                            "name",
                                                            "tab"
                                                        ])), 64))
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "value"
                                        ]),
                                        r(n(dt), {
                                            onRegister: n(B),
                                            onSubmit: l,
                                            onReset: l
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            r(x, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: i(()=>[
                                        r(n(bt), {
                                            ref_key: "basicTableRef",
                                            ref: b,
                                            columns: n(D),
                                            request: (o)=>A(o, n(S)()),
                                            "row-key": (o)=>o.id,
                                            autoScrollX: !0,
                                            actionColumn: n(R),
                                            immediate: !1,
                                            "virtual-scroll": ""
                                        }, {
                                            tableTitle: i(()=>[
                                                    r(L, null, {
                                                        default: i(()=>[
                                                                r(I, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: i(()=>[
                                                                            st((u(), d(q, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: t[2] || (t[2] = (o)=>E())
                                                                            }, {
                                                                                icon: i(()=>[
                                                                                        (u(), d(mt(n(c)(n(p).add))))
                                                                                    ]),
                                                                                _: 1
                                                                            })), [
                                                                                [
                                                                                    $,
                                                                                    {
                                                                                        action: [
                                                                                            "crew:training:otherAdd"
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            ])
                                                                        ]),
                                                                    default: i(()=>[
                                                                            at(" " + rt(n(a)("common.addText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { ue as default, __tla };
