import { V as y, d as q, u as W, r, a as j, Z as c, ac as U, c_ as z, aw as G, c as H, o as X, w as a, j as s, W as Y, l as m, H as Z, aI as J, p as L, B as O, i as Q, X as ee, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as oe } from "./BasicForm-dL_oCSPM.js";
import { B as te } from "./Table-0PViRYCf.js";
import { _ as ne } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { d as ae, a as se } from "./tree-Doz7tklw.js";
import { _ as re, __tla as __tla_1 } from "./modal.vue_vue_type_script_setup_true_lang-DVoHscCw.js";
import { u as ie } from "./useForm-CKmgcynv.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 "./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 "./usePageCache-DluHn7Yy.js";
import "./Flex-CTSf12gq.js";
import "./template-rpthWlT9.js";
let Je;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let le, ce, Ze, me;
    ({ t: le } = y());
    ce = [
        {
            field: "name",
            component: "NInput",
            componentProps: {
                placeholder: le("common.queryCriteria")
            }
        }
    ];
    ({ t: Ze } = y());
    me = [
        {
            title: "Name",
            key: "name",
            align: "left",
            ellipsis: !1,
            width: 400
        },
        {
            title: "NameEn",
            key: "nameEn",
            ellipsis: !1,
            width: 400
        },
        {
            title: "BusinessKey",
            key: "businessKey",
            render (i) {
                return i.businessKey ? i.businessKey : "-";
            }
        },
        {
            title: "Type",
            key: "type"
        },
        {
            title: "IsParent",
            key: "orderNum",
            render (i) {
                return i.isParent === 1 ? "Yes" : "No";
            }
        }
    ];
    Je = q({
        __name: "tree",
        setup (i) {
            const { t } = y(), p = W(), g = z(), d = r(), w = r([]), v = r(), T = r([]), u = r(""), n = r(), b = r([]), [k, { getFieldsValue: x }] = ie({
                gridProps: {
                    cols: "4",
                    xGap: "15"
                },
                labelWidth: 80,
                schemas: ce,
                showAdvancedButton: !1
            }), C = j({
                width: 150,
                title: t("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return c(ne, {
                        style: "text",
                        actions: [
                            {
                                label: "Add New",
                                labelShow: !1,
                                icon: c("i", {
                                    class: "iconfont icon-ADD"
                                }),
                                onClick: K.bind(null, e)
                            },
                            {
                                label: t("common.optionsEditText"),
                                labelShow: !1,
                                icon: c("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: A.bind(null, e)
                            },
                            {
                                label: t("common.optionsDelText"),
                                labelShow: !1,
                                icon: c("i", {
                                    class: "iconfont icon-Delete red"
                                }),
                                onClick: F.bind(null, e)
                            }
                        ]
                    });
                }
            }), D = async (e, o)=>({
                    list: (await se("all"))?.root || []
                });
            function P(e) {
                f();
            }
            function B(e) {
                f();
            }
            function R() {
                d.value.reload();
            }
            function N(e) {
                w.value = e, v.value = T.value.filter((o)=>e.includes(o.id)).map((o)=>o.username).join("，");
            }
            function f() {
                d.value.reload();
            }
            function I() {
                n.value.openModal();
            }
            function K(e) {
                u.value = "addChildren", n.value.setProps({
                    title: "Add Tree Children"
                }), n.value.openModal(), n.value.setChildrenInfo(e);
            }
            function A(e) {
                U(()=>{
                    u.value = "edit", n.value.setProps({
                        title: "Edit Tree Info"
                    }), n.value.openModal(), n.value.setFormParams(e);
                });
            }
            function F(e) {
                g.info({
                    title: t("common.delPop.title"),
                    content: t("common.delPop.cont"),
                    positiveText: t("common.okText"),
                    negativeText: t("common.cancelText"),
                    onPositiveClick: async ()=>{
                        if (e.children && e.children.length > 0) {
                            p.warning("If there are child nodes under the node, please delete them first");
                            return;
                        } else try {
                            await ae(e.id), p.success(t("common.delPop.success")), f();
                        } catch  {
                            p.error(t("common.delPop.error"));
                        }
                    }
                });
            }
            async function S() {}
            return G(()=>{
                S();
            }), (e, o)=>{
                const h = oe, _ = Y, E = O, M = J, V = Z, $ = ee;
                return X(), H($, null, {
                    default: a(()=>[
                            s(_, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: a(()=>[
                                        s(h, {
                                            onRegister: m(k),
                                            onSubmit: P,
                                            onReset: B
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            s(_, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: a(()=>[
                                        s(m(te), {
                                            columns: m(me),
                                            request: (l)=>D(l, m(x)()),
                                            "row-key": (l)=>l.id,
                                            ref_key: "basicTableRef",
                                            ref: d,
                                            actionColumn: C,
                                            "default-expand-all": "",
                                            "onUpdate:checkedRowKeys": N,
                                            pagination: !0,
                                            "virtual-scroll": "",
                                            "expanded-row-keys": b.value,
                                            "onUpdate:expandedRowKeys": o[0] || (o[0] = (l)=>b.value = l)
                                        }, {
                                            tableTitle: a(()=>[
                                                    s(V, null, {
                                                        default: a(()=>[
                                                                s(M, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: a(()=>[
                                                                            s(E, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-8",
                                                                                onClick: I
                                                                            }, {
                                                                                icon: a(()=>o[1] || (o[1] = [
                                                                                        Q("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: a(()=>[
                                                                            o[2] || (o[2] = L(" Add "))
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn",
                                            "expanded-row-keys"
                                        ])
                                    ]),
                                _: 1
                            }),
                            s(re, {
                                ref_key: "createDrawerRef",
                                ref: n,
                                addType: u.value,
                                onSuccess: R
                            }, null, 8, [
                                "addType"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Je as default, __tla };
