import { V as $, bk as A, d as se, e as le, r as l, a as ie, Z as h, cZ as re, c as D, o as b, w as a, j as n, U as me, M as ce, W as ue, i as k, k as pe, ds as de, l as o, N as _e, dA as fe, h as ye, aB as ge, cB as ve, H as he, B as be, p as K, A as L, eG as ke, D as we, aI as Te, X as xe, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as De } from "./Table-0PViRYCf.js";
import { _ as Fe } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as Ce } from "./BasicForm-dL_oCSPM.js";
import { u as Se } from "./useForm-CKmgcynv.js";
import { d as Be } from "./download-CIBdrxiA.js";
import { a as Re, d as Ee, g as Ne, b as Ve, c as Ke } from "./smsFormsTemplate-Dsea_L5v.js";
import { g as Le, c as $e, __tla as __tla_1 } from "./schemas-VNkutZfL.js";
import { r as Ae } from "./dictUtils-D8jA3mBt.js";
import { _ as Ie } from "./Modal.vue_vue_type_script_setup_true_lang-BBO7kgdL.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 "./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 "./base64Conver-4Xd-Hzyx.js";
import "./isEmpty-BUg1OsQj.js";
import "./jobOrder-CGbsc7bp.js";
import "./event-CLiVQHeO.js";
import "./account-C850CBTF.js";
import "./has-CjqcrIOV.js";
let zt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: i } = $(), ze = A(), Ue = await Re("sms_template_type"), je = await Le();
    function qe() {
        return {
            tableColumns: [
                {
                    title: i("common.messagedefine.Num"),
                    key: "num",
                    width: 60,
                    render: (s, p)=>p + 1
                },
                {
                    title: i("mdm.smsFormsTemplate.smsFileCode"),
                    key: "code",
                    width: 100
                },
                {
                    title: i("mdm.smsFormsTemplate.smsFileNameEn"),
                    key: "nameEn",
                    width: 160
                },
                {
                    title: i("mdm.smsFormsTemplate.smsFileNameCn"),
                    key: "nameCn",
                    width: 160
                },
                {
                    title: i("mdm.smsFormsTemplate.smsFileVersion"),
                    key: "version",
                    width: 100
                },
                {
                    title: i("mdm.smsFormsTemplate.fileType"),
                    key: "type",
                    width: 80,
                    render: (s)=>{
                        const p = Ue.find((w)=>w.value === s.type);
                        return ze.getLocale === "en" ? p?.labelEn : p?.label;
                    }
                },
                {
                    title: i("mdm.smsFormsTemplate.status"),
                    key: "status",
                    width: 80,
                    render: (s)=>Ae(je, s.status)
                },
                {
                    title: i("mdm.smsFormsTemplate.createDate"),
                    key: "createDate",
                    width: 100
                },
                {
                    title: i("mdm.smsFormsTemplate.createBy"),
                    key: "createBy",
                    width: 100
                },
                {
                    title: i("mdm.smsFormsTemplate.approveDate"),
                    key: "approveDate",
                    width: 100
                },
                {
                    title: i("mdm.smsFormsTemplate.approveBy"),
                    key: "approveByName",
                    width: 100
                }
            ]
        };
    }
    let Oe, Pe, Me, We;
    Oe = {
        class: "flex items-center"
    };
    Pe = {
        class: "w-full menu"
    };
    Me = {
        class: "py-3 menu-list"
    };
    We = {
        key: 0,
        class: "flex items-center justify-center py-4"
    };
    zt = se({
        __name: "index",
        setup (I) {
            const { t: s } = $(), p = A(), w = re(), F = le(), { tableColumns: z } = qe(), C = l(), S = l(), g = l(""), v = l(!1), _ = l([]), f = l(), m = l([]), c = l([]), u = l(), B = l(), R = l(!1), U = ie({
                width: 140,
                title: s("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return h(Fe, {
                        style: "text",
                        actions: [
                            {
                                label: s("common.optionsEditText"),
                                labelShow: !1,
                                icon: h("i", {
                                    class: "iconfont icon-a-Frame28 text-[22px]"
                                }),
                                onClick: E.bind(null, e, "edit"),
                                ifShow: [
                                    1,
                                    3
                                ].includes(e.status)
                            },
                            {
                                label: s("common.optionsDelText"),
                                labelShow: !1,
                                icon: h("i", {
                                    class: "iconfont icon-Delete"
                                }),
                                color: "red",
                                isConfirm: !0,
                                confirmContent: s("common.dialogContentDeleteText"),
                                onPositiveClick: ()=>{
                                    M(e);
                                },
                                ifShow: [
                                    1,
                                    3
                                ].includes(e.status)
                            },
                            {
                                label: s("common.optionsViewText"),
                                labelShow: !1,
                                icon: h("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[23px]"
                                }),
                                onClick: P.bind(null, e, "view")
                            }
                        ]
                    });
                }
            });
            async function j(e, t) {
                if (t.createDate && t.createDate.length !== 0 && (t.createDate = t.createDate.join(",")), !R.value) {
                    R.value = !0;
                    const d = await H();
                    if (console.log(d), !d) return;
                    if (m.value = [
                        d[0]
                    ], !m.value) return [];
                }
                return B.value = await Ne({
                    category: m.value[0]
                }), await Ve({
                    ...e,
                    ...t,
                    category: u.value?.key
                });
            }
            function q() {
                f.value ? (_.value = [], f.value = !1) : (_.value = o(c).map((e)=>e.key), f.value = !0);
            }
            function O() {
                C.value?.showModal({}, "add");
            }
            function E(e, t) {
                console.log(e), F.push({
                    name: "smsFormDetail",
                    query: {
                        id: e.id,
                        category: u.value?.key,
                        type: t
                    }
                });
            }
            function P(e, t) {
                e.type === "1" ? F.push({
                    name: "smsFormDetail",
                    query: {
                        id: e.id,
                        category: u.value?.key,
                        type: t
                    }
                }) : W(e);
            }
            async function M(e) {
                await Ee(e.id), w.success(s("common.optionsDelSuccessText")), y();
            }
            function W(e) {
                Be({
                    url: e.url
                });
            }
            function G(e) {
                _.value = e;
            }
            function y() {
                S.value?.restReload();
            }
            async function H() {
                v.value = !0;
                try {
                    return c.value = await Ke({
                        locale: p.getLocale
                    }), m.value = [
                        o(c)[0]?.key
                    ], u.value = o(c)[0], _.value = o(c).map((e)=>e.key), f.value = !0, v.value = !1, m.value;
                } catch (e) {
                    console.log(e), c.value = [], v.value = !1;
                }
            }
            function X(e, t) {
                m.value = e, u.value = t?.[0], y();
            }
            const { searchSchemas: Z } = $e({
                templateList: B
            }), [J, { getFieldsValue: Q }] = Se({
                gridProps: {
                    cols: 5
                },
                schemas: Z
            });
            return (e, t)=>{
                const T = _e, d = be, N = he, Y = pe, ee = ge, te = ve, x = ue, V = ce, oe = Te, ae = me, ne = xe;
                return b(), D(ne, null, {
                    default: a(()=>[
                            n(ae, {
                                cols: "1 s:1 m:1 l:6 xl:6 2xl:6",
                                responsive: "screen",
                                "x-gap": 8
                            }, {
                                default: a(()=>[
                                        n(V, {
                                            span: "1"
                                        }, {
                                            default: a(()=>[
                                                    n(x, {
                                                        segmented: {
                                                            content: "hard"
                                                        },
                                                        bordered: !1,
                                                        size: "small"
                                                    }, {
                                                        header: a(()=>[
                                                                n(N, null, {
                                                                    default: a(()=>[
                                                                            n(d, {
                                                                                type: "primary",
                                                                                ghost: "",
                                                                                "icon-placement": "left",
                                                                                onClick: q
                                                                            }, {
                                                                                icon: a(()=>[
                                                                                        k("div", Oe, [
                                                                                            n(T, {
                                                                                                size: "14"
                                                                                            }, {
                                                                                                default: a(()=>[
                                                                                                        n(o(ke))
                                                                                                    ]),
                                                                                                _: 1
                                                                                            })
                                                                                        ])
                                                                                    ]),
                                                                                default: a(()=>[
                                                                                        K(L(o(f) ? "Collapse" : "Expand") + " ", 1)
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        default: a(()=>[
                                                                k("div", Pe, [
                                                                    n(Y, {
                                                                        value: o(g),
                                                                        "onUpdate:value": t[0] || (t[0] = (r)=>de(g) ? g.value = r : null)
                                                                    }, {
                                                                        suffix: a(()=>[
                                                                                n(T, {
                                                                                    size: "18",
                                                                                    class: "cursor-pointer"
                                                                                }, {
                                                                                    default: a(()=>[
                                                                                            n(o(fe))
                                                                                        ]),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        _: 1
                                                                    }, 8, [
                                                                        "value"
                                                                    ]),
                                                                    k("div", Me, [
                                                                        o(v) ? (b(), ye("div", We, [
                                                                            n(ee, {
                                                                                size: "medium"
                                                                            })
                                                                        ])) : (b(), D(te, {
                                                                            key: 1,
                                                                            "block-line": "",
                                                                            cascade: "",
                                                                            "virtual-scroll": !0,
                                                                            pattern: o(g),
                                                                            data: o(c),
                                                                            expandedKeys: o(_),
                                                                            selectedKeys: o(m),
                                                                            cancelable: !1,
                                                                            style: {
                                                                                "max-height": "650px",
                                                                                overflow: "hidden"
                                                                            },
                                                                            "onUpdate:selectedKeys": X,
                                                                            "onUpdate:expandedKeys": G
                                                                        }, null, 8, [
                                                                            "pattern",
                                                                            "data",
                                                                            "expandedKeys",
                                                                            "selectedKeys"
                                                                        ]))
                                                                    ])
                                                                ])
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }),
                                        n(V, {
                                            span: "5"
                                        }, {
                                            default: a(()=>[
                                                    n(x, {
                                                        class: "mb-[8px] proCard"
                                                    }, {
                                                        default: a(()=>[
                                                                n(o(Ce), {
                                                                    onRegister: o(J),
                                                                    onSubmit: t[1] || (t[1] = (r)=>y()),
                                                                    onReset: t[2] || (t[2] = (r)=>y())
                                                                }, null, 8, [
                                                                    "onRegister"
                                                                ])
                                                            ]),
                                                        _: 1
                                                    }),
                                                    n(x, {
                                                        class: "proCard"
                                                    }, {
                                                        default: a(()=>[
                                                                n(o(De), {
                                                                    ref_key: "basicTableRef",
                                                                    ref: S,
                                                                    columns: o(z),
                                                                    request: (r)=>j(r, o(Q)()),
                                                                    "row-key": (r)=>r.id,
                                                                    actionColumn: o(U),
                                                                    autoScrollX: !0,
                                                                    "virtual-scroll": ""
                                                                }, {
                                                                    tableTitle: a(()=>[
                                                                            n(N, null, {
                                                                                default: a(()=>[
                                                                                        o(u)?.children?.length ? we("", !0) : (b(), D(oe, {
                                                                                            key: 0,
                                                                                            trigger: "hover"
                                                                                        }, {
                                                                                            trigger: a(()=>[
                                                                                                    n(d, {
                                                                                                        type: "primary",
                                                                                                        strong: "",
                                                                                                        bordered: "",
                                                                                                        secondary: "",
                                                                                                        class: "size-7",
                                                                                                        onClick: O
                                                                                                    }, {
                                                                                                        icon: a(()=>t[4] || (t[4] = [
                                                                                                                k("i", {
                                                                                                                    class: "iconfont icon-ADD"
                                                                                                                }, null, -1)
                                                                                                            ])),
                                                                                                        _: 1
                                                                                                    })
                                                                                                ]),
                                                                                            default: a(()=>[
                                                                                                    K(" " + L(o(s)("common.addText")), 1)
                                                                                                ]),
                                                                                            _: 1
                                                                                        }))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    _: 1
                                                                }, 8, [
                                                                    "columns",
                                                                    "request",
                                                                    "row-key",
                                                                    "actionColumn"
                                                                ])
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            }),
                            n(Ie, {
                                ref_key: "modalRef",
                                ref: C,
                                selectedTreeItem: o(u),
                                onEdit: E,
                                onSuccess: t[3] || (t[3] = (r)=>y())
                            }, null, 8, [
                                "selectedTreeItem"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { zt as default, __tla };
