import { V as k, bk as P, Z as x, ae as W, d as E, r as y, a as V, gW as g, gX as _, cZ as O, aw as X, c as C, o as h, w as l, j as i, W as $, l as r, H as q, B as A, ca as Z, X as j, __tla as __tla_0 } from "./index-9PRMimni.js";
import { e as z, g as H } from "./configureForm-RWeNQ4IB.js";
import { B as G } from "./BasicForm-dL_oCSPM.js";
import { u as J } from "./useForm-CKmgcynv.js";
import { c as K, _ as Q, __tla as __tla_1 } from "./AddModal.vue_vue_type_script_setup_true_lang-BAW6Kp4Q.js";
import { a5 as U, a6 as Y, _ as ee } from "./template-rpthWlT9.js";
import { g as oe, __tla as __tla_2 } from "./columns-CcSTU2Qa.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 "./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 "./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 { __tla as __tla_3 } from "./schemas-DzvLPsci.js";
import "./isEmpty-BUg1OsQj.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 "./useTimeout-BxFilWvD.js";
import "./Flex-CTSf12gq.js";
let Je;
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 ()=>{
    const { t: s } = k(), b = P(), re = await U(), ae = await ee(), ie = await Y();
    function se() {
        return {
            columns: [
                {
                    title: s("configureForm.no"),
                    key: "",
                    width: 60,
                    render (e, o) {
                        return o + 1;
                    }
                },
                {
                    title: s("configureForm.chineseName"),
                    key: "contentCn"
                },
                {
                    title: s("configureForm.englishName"),
                    key: "contentEn"
                },
                {
                    title: s("configureForm.module"),
                    key: "module",
                    render: (e)=>{
                        const o = re.find((n)=>n.value === e.module);
                        return b.getLocale === "en" ? o?.labelEn : o?.label;
                    }
                },
                {
                    title: s("configureForm.shipCategory"),
                    width: 170,
                    key: "shipCategory",
                    render: (e)=>{
                        const o = ie.find((n)=>n.value === e.shipCategory);
                        return b.getLocale === "en" ? o?.labelEn : o?.label;
                    }
                },
                {
                    title: s("configureForm.rank"),
                    key: "rank",
                    render: (e)=>{
                        const o = ae.find((p)=>p.id == e.rank) || {}, n = Number(o.deptType) || 0, a = oe(n), u = b.getLocale === "en" ? o.shortNameEn || "-" : o.name || "-";
                        return x(W, {
                            style: {
                                backgroundColor: a.backgroundColor,
                                color: a.textColor,
                                borderColor: a.borderColor,
                                borderWidth: "1px",
                                borderStyle: "solid",
                                borderRadius: "4px",
                                padding: "2px 8px"
                            },
                            bordered: !1
                        }, {
                            default: ()=>u
                        });
                    }
                },
                {
                    title: s("configureForm.sort"),
                    key: "sort"
                }
            ]
        };
    }
    Je = E({
        __name: "index",
        setup (w) {
            const { t: e } = k(), o = O(), n = y(), a = y(), { columns: u } = se(), p = V({
                width: 200,
                title: e("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (t) {
                    return x(ne, {
                        style: "text",
                        actions: [
                            {
                                label: e("configureForm.edit"),
                                labelShow: !1,
                                icon: g(_.edit, "text-[18px]"),
                                onClick: B.bind(null, t)
                            },
                            {
                                label: e("configureForm.remove"),
                                labelShow: !1,
                                icon: g(_.delete, "text-[#ed8788] text-[16px]"),
                                onPositiveClick: M.bind(null, t),
                                isConfirm: !0,
                                confirmContent: e("configureForm.removePrompt"),
                                positiveText: e("common.okText")
                            }
                        ]
                    });
                }
            }), { schemas: T } = K(), [F, { getFieldsValue: R }] = J({
                gridProps: {
                    cols: "2 s:3 m:4 l:5 xl:6"
                },
                schemas: T,
                labelWidth: "auto",
                labelPlacement: "top",
                showAdvancedButton: !0
            });
            async function v(t, m) {
                return H({
                    ...t,
                    ...m
                });
            }
            function c() {
                n.value?.reload();
            }
            function S() {
                a.value?.handleOpenModal(e("configureForm.addText"), {});
            }
            function B(t) {
                a.value?.handleOpenModal(e("configureForm.edit"), t);
            }
            async function M(t) {
                await z({
                    id: t.id,
                    isDeleted: 1
                }), o.success(e("common.delPop.success")), c();
            }
            function L() {
                c();
            }
            return X(()=>{
                L();
            }), (t, m)=>{
                const f = $, D = A, I = q, N = j;
                return h(), C(N, null, {
                    default: l(()=>[
                            i(f, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: l(()=>[
                                        i(r(G), {
                                            onRegister: r(F),
                                            onSubmit: c,
                                            onReset: c
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            i(f, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: l(()=>[
                                        i(r(te), {
                                            ref_key: "basicTableRef",
                                            ref: n,
                                            columns: r(u),
                                            request: (d)=>v(d, r(R)()),
                                            "row-key": (d)=>d.id,
                                            autoScrollX: !0,
                                            actionColumn: r(p),
                                            immediate: !1,
                                            "virtual-scroll": ""
                                        }, {
                                            tableTitle: l(()=>[
                                                    i(I, null, {
                                                        default: l(()=>[
                                                                i(D, {
                                                                    type: "primary",
                                                                    strong: "",
                                                                    bordered: "",
                                                                    secondary: "",
                                                                    class: "size-7",
                                                                    onClick: m[0] || (m[0] = (d)=>S())
                                                                }, {
                                                                    icon: l(()=>[
                                                                            (h(), C(Z(r(g)(r(_).add))))
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            i(Q, {
                                ref_key: "addModalRef",
                                ref: a,
                                onSuccess: c
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Je as default, __tla };
