import { V as v, Z as m, O as Q, ae as T, d as Y, u as ee, r as l, a as oe, ac as te, fj as ne, fk as N, c as ae, o as se, w as t, j as n, W as le, l as r, k as re, H as ie, aI as ce, p as C, B as me, i as R, A as D, S as ue, fl as pe, X as de, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as fe } from "./Table-0PViRYCf.js";
import { _ as _e } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as be } from "./BasicForm-dL_oCSPM.js";
import { u as he } from "./useForm-CKmgcynv.js";
import { _ as ge, __tla as __tla_1 } from "./CreateModal.vue_vue_type_script_setup_true_lang-D0KktkSr.js";
import { _ as Ce } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { u as ve } from "./useModal-CO65vga3.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 "./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 "./Password-BeBc6acq.js";
import "./dept-C5ivQanA.js";
import "./template-rpthWlT9.js";
import "./company-PiwOjwod.js";
let mo;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let i, we, c, ye, ke;
    ({ t: i } = v());
    we = [
        {
            title: "No.",
            key: "num",
            width: 60,
            render: (s, o)=>o + 1
        },
        {
            title: i("common.userController.username"),
            key: "username",
            width: 120,
            ifShow: !1
        },
        {
            title: i("common.userController.nickname"),
            key: "nickname",
            width: 100,
            ifShow: !1
        },
        {
            title: i("common.userController.avatar"),
            key: "avatar",
            render (s) {
                return m(Q, {
                    alt: "这是一个图片说明",
                    width: 32,
                    src: s.avatar,
                    round: !0
                });
            },
            width: 100
        },
        {
            title: i("common.userController.phone"),
            key: "phone",
            width: 100
        },
        {
            title: i("common.userController.role"),
            key: "roleNames",
            width: 120,
            render (s) {
                return m(T, {
                    bordered: !1,
                    type: "info"
                }, {
                    default: ()=>s.roleNames
                });
            }
        },
        {
            title: i("common.userController.status"),
            key: "status",
            width: 80,
            render (s) {
                return m(T, {
                    bordered: !1,
                    type: s.status === 1 ? "success" : "error"
                }, {
                    default: ()=>s.status === 1 ? "Enable" : "Disable"
                });
            }
        },
        {
            title: i("common.userController.managementCompany"),
            key: "companyName",
            width: 160
        },
        {
            title: i("common.userController.doc"),
            key: "docNameCn",
            width: 160
        }
    ];
    ({ t: c } = v());
    ye = [
        {
            field: "username",
            component: "NInput",
            label: c("common.userController.username"),
            componentProps: {
                placeholder: c("common.userController.placeholderUsername")
            }
        },
        {
            field: "phone",
            component: "NInput",
            label: c("common.userController.phone"),
            componentProps: {
                placeholder: c("common.userController.placeholderPhone")
            }
        },
        {
            field: "status",
            component: "NSelect",
            label: c("common.userController.status"),
            componentProps: {
                placeholder: c("common.userController.placeholderStatus"),
                options: [
                    {
                        label: c("common.userController.normal"),
                        value: 1
                    },
                    {
                        label: c("common.userController.disable"),
                        value: 0
                    }
                ]
            }
        }
    ];
    ke = {
        class: "text-gray-600",
        style: {
            "padding-left": "35px"
        }
    };
    mo = Y({
        __name: "user",
        setup (s) {
            const { t: o } = v(), b = ee(), w = l(), u = l(), B = l([]), h = l([]), f = l(), y = l(), g = l(!1), U = l("添加用户"), M = oe({
                width: 120,
                title: o("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return m(_e, {
                        style: "text",
                        actions: [
                            {
                                label: o("common.optionsDelText"),
                                labelShow: !1,
                                icon: m("i", {
                                    class: "iconfont icon-Delete red"
                                }),
                                onPositiveClick: ()=>{
                                    K(e);
                                },
                                onNegativeClick: ()=>{},
                                isConfirm: !0,
                                confirmContent: o("common.delPop.cont")
                            },
                            {
                                label: o("common.optionsEditText"),
                                labelShow: !1,
                                icon: m("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: $.bind(null, e)
                            },
                            {
                                label: o("common.optionsDisableText"),
                                labelShow: !1,
                                icon: m("i", {
                                    class: "iconfont icon-jinyong1"
                                }),
                                onPositiveClick: ()=>{
                                    k(e);
                                },
                                onNegativeClick: ()=>{},
                                isConfirm: !0,
                                confirmContent: o("common.disablePop.disableCont"),
                                ifShow: ()=>e.status === 1
                            },
                            {
                                label: o("common.optionsEnableText"),
                                icon: m("i", {
                                    class: "iconfont icon-qiyong1"
                                }),
                                labelShow: !1,
                                onPositiveClick: ()=>{
                                    k(e);
                                },
                                onNegativeClick: ()=>{},
                                isConfirm: !0,
                                confirmContent: o("common.disablePop.ableCont"),
                                ifShow: ()=>e.status === 0
                            }
                        ]
                    });
                }
            }), I = async (e, a)=>{
                const _ = await pe({
                    ...e,
                    ...a
                });
                return y.value = _.list, _;
            };
            function E(e) {
                B.value = e, h.value = y.value.filter((a)=>e.includes(a.id)).map((a)=>a.username).join("，");
            }
            function p() {
                w.value.reload();
            }
            function $(e) {
                e.mobile = parseInt(e.mobile), S(), te(()=>{
                    g.value = !0, u.value.setProps({
                        title: o("common.editPop.titleUser")
                    }), u.value.getData(e.id);
                });
            }
            async function k(e) {
                await ne(e.id, e.status === 1 ? 0 : 1), b.success(o("common.disablePop.success")), p();
            }
            async function K(e) {
                h.value = e.username, f.value = e.id, await N(f.value), b.success("Operation succesfully!"), p();
            }
            function O(e) {
                p();
            }
            function V(e) {
                p();
            }
            const [j, { getFieldsValue: A }] = he({
                gridProps: {
                    cols: "4",
                    xGap: "15"
                },
                labelWidth: 80,
                schemas: ye,
                showAdvancedButton: !1
            }), [F, { closeModal: q, setSubLoading: L }] = ve({
                title: o("common.delPop.title"),
                showIcon: !0,
                type: "warning",
                closable: !1,
                maskClosable: !0,
                width: 380,
                subBtuText: o("common.okText"),
                cancelText: o("common.cancelText")
            });
            function S() {
                g.value = !1, u.value.setProps({
                    title: o("common.addPop.titleUser")
                }), u.value.getData(null), u.value.openModal();
            }
            async function W() {
                console.log("rowKeysId", f), await N(f.value), q(), L(), b.success("删除成功"), p();
            }
            return (e, a)=>{
                const _ = re, x = le, X = me, z = ce, G = ie, H = ue, Z = de;
                return se(), ae(Z, null, {
                    default: t(()=>[
                            n(x, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: t(()=>[
                                        n(r(be), {
                                            onRegister: r(j),
                                            onSubmit: O,
                                            onReset: V
                                        }, {
                                            statusSlot: t(({ model: d, field: P })=>[
                                                    n(_, {
                                                        value: d[P],
                                                        "onUpdate:value": (J)=>d[P] = J
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            n(x, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: t(()=>[
                                        n(r(fe), {
                                            columns: r(we),
                                            request: (d)=>I(d, r(A)()),
                                            "row-key": (d)=>d.id,
                                            ref_key: "basicTableRef",
                                            ref: w,
                                            actionColumn: M,
                                            "onUpdate:checkedRowKeys": E,
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, {
                                            tableTitle: t(()=>[
                                                    n(G, null, {
                                                        default: t(()=>[
                                                                n(z, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: t(()=>[
                                                                            n(X, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: S
                                                                            }, {
                                                                                icon: t(()=>a[0] || (a[0] = [
                                                                                        R("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: t(()=>[
                                                                            a[1] || (a[1] = C(" Add "))
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            n(r(Ce), {
                                onRegister: r(F),
                                ref: "modalRef",
                                onOnOk: W
                            }, {
                                default: t(()=>[
                                        R("p", ke, [
                                            C(D(r(o)("common.delPop.cont")) + "：", 1),
                                            n(H, {
                                                strong: ""
                                            }, {
                                                default: t(()=>[
                                                        C(D(h.value) + " ?", 1)
                                                    ]),
                                                _: 1
                                            })
                                        ])
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister"
                            ]),
                            n(ge, {
                                ref_key: "createModalRef",
                                ref: u,
                                title: U.value,
                                isEdit: g.value,
                                onSuccess: p
                            }, null, 8, [
                                "title",
                                "isEdit"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { mo as default, __tla };
