import { ad as N, V as f, gL as i, bk as S, d as x, e as F, r as D, a as E, Z as c, gW as L, iP as O, iO as K, iN as V, gX as W, c as A, o as X, w as d, j as p, W as $, l as m, X as j, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as G } from "./BasicForm-dL_oCSPM.js";
import { B as H } from "./Table-0PViRYCf.js";
import { _ as M } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { r as a } from "./dictUtils-D8jA3mBt.js";
import { u as Z } from "./useForm-CKmgcynv.js";
import { i as w } from "./isEmpty-BUg1OsQj.js";
import { h as P } from "./has-CjqcrIOV.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";
let Ae;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    function z(l) {
        return N.Get("/sms/database/form/page", {
            params: l
        });
    }
    const J = S(), { t } = f(), Q = await i("sms_category"), U = await i("sms_section"), Y = await i("sms_frequency"), k = await i("sms_report_status"), ee = await i("sms_file_status");
    function se() {
        return {
            columns: [
                {
                    title: t("common.messagedefine.Num"),
                    key: "num",
                    width: 60,
                    render: (s, o)=>o + 1
                },
                {
                    title: t("sms.smsPlan.smsCategory"),
                    key: "smsCategory",
                    width: 100,
                    render: (s)=>a(Q, s.smsCategory)
                },
                {
                    title: t("sms.smsPlan.smsSection"),
                    key: "section",
                    width: 80,
                    render: (s)=>a(U, s.section)
                },
                {
                    title: t("sms.smsPlan.smsFileCode"),
                    key: "code",
                    width: 100
                },
                {
                    title: t("sms.smsPlan.smsFileNameEn"),
                    key: "nameEn",
                    width: 120
                },
                {
                    title: t("sms.smsPlan.smsFileNameCn"),
                    key: "nameCn",
                    width: 120
                },
                {
                    title: t("sms.smsPlan.smsFileVersion"),
                    key: "version",
                    width: 100
                },
                {
                    title: t("sms.smsPlan.interval"),
                    key: "frequency",
                    width: 80,
                    render: (s)=>a(Y, s.frequency)
                },
                {
                    title: t("sms.smsPlan.reportBy"),
                    key: J.getLocale === "en" ? "roleNamesEn" : "roleNames",
                    width: 100
                },
                {
                    title: t("sms.smsPlan.lastReportDate"),
                    key: "lastReportDate",
                    width: 100
                },
                {
                    title: t("sms.smsPlan.status"),
                    key: "status",
                    width: 100,
                    render: (s)=>s.status && s.approveStatus ? a(k, s.status) + "-" + a(ee, s.approveStatus) : a(k, s.status)
                }
            ]
        };
    }
    const { t: n } = f();
    function te() {
        return {
            schemas: [
                {
                    field: "section",
                    component: "BasicSelect",
                    label: n("sms.smsPlan.smsSection"),
                    componentProps: {
                        cacheKey: "sms_section",
                        block: !0
                    }
                },
                {
                    field: "roleCode",
                    component: "BasicSelect",
                    label: n("sms.smsPlan.roleType"),
                    componentProps: {
                        cacheKey: "sms_report_role",
                        block: !0
                    }
                },
                {
                    field: "frequency",
                    component: "BasicSelect",
                    label: n("sms.smsPlan.interval"),
                    componentProps: {
                        optionType: "number",
                        cacheKey: "sms_frequency",
                        block: !0
                    }
                },
                {
                    field: "busType",
                    component: "BasicSelect",
                    label: n("sms.smsPlan.businessType"),
                    componentProps: {
                        cacheKey: "sms_busType",
                        block: !0,
                        optionType: "number"
                    }
                },
                {
                    field: "code",
                    component: "NInput",
                    label: n("sms.smsPlan.smsFileCode"),
                    componentProps: {}
                },
                {
                    field: "smsName",
                    component: "NInput",
                    label: n("sms.smsPlan.smsFileNameEnOrCn"),
                    componentProps: {}
                },
                {
                    field: "status",
                    component: "BasicSelect",
                    label: n("sms.smsPlan.status"),
                    componentProps: {
                        cacheKey: "sms_report_status",
                        block: !0
                    }
                }
            ]
        };
    }
    Ae = x({
        __name: "index",
        setup (l) {
            const s = S(), { t: o } = f(), r = F(), { columns: g } = se(), { schemas: C } = te(), [T, { getFieldsValue: I }] = Z({
                gridProps: {
                    cols: 6
                },
                schemas: C
            }), y = D(), R = E({
                width: 140,
                title: o("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return c(M, {
                        style: "text",
                        actions: [
                            {
                                label: o("sms.smsPlan.report"),
                                labelShow: !1,
                                icon: c(O),
                                onClick: ()=>{
                                    r.push({
                                        name: "smsDetail",
                                        query: {
                                            templateId: e.templateId,
                                            shipId: e.shipId,
                                            type: "add"
                                        }
                                    });
                                },
                                ifShow: (!P(e, "fileId") || w(e.fileId)) && [
                                    2
                                ].includes(e.status) && e.canReport
                            },
                            {
                                label: o("sms.smsPlan.viewReport"),
                                labelShow: !1,
                                icon: c(K),
                                onClick: ()=>{
                                    r.push({
                                        name: "smsDetail",
                                        query: {
                                            id: e.fileId,
                                            type: "view"
                                        }
                                    });
                                },
                                ifShow: P(e, "fileId") || !w(e.fileId)
                            },
                            {
                                label: o("sms.smsPlan.history"),
                                labelShow: !1,
                                icon: c(V, {
                                    class: "text-[#0EC06A] text-[14px]"
                                }),
                                onClick: ()=>{
                                    r.push({
                                        name: "smsHistory",
                                        query: {
                                            frequency: e.frequency,
                                            name: s.getLocale === "en" ? e.nameEn : e.nameCn
                                        }
                                    });
                                }
                            },
                            {
                                label: o("common.optionsViewText"),
                                labelShow: !1,
                                icon: L(W.view, "blue"),
                                onClick: ()=>{
                                    r.push({
                                        name: "smsTemplateDetail",
                                        query: {
                                            id: e.templateId,
                                            type: "view",
                                            module: "smsTemplate"
                                        }
                                    });
                                }
                            }
                        ]
                    });
                }
            });
            function _() {
                y.value?.restReload();
            }
            async function q(e, h) {
                return await z({
                    ...e,
                    ...h
                });
            }
            return (e, h)=>{
                const v = G, b = $, B = j;
                return X(), A(B, null, {
                    default: d(()=>[
                            p(b, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: d(()=>[
                                        p(v, {
                                            onRegister: m(T),
                                            onSubmit: _,
                                            onReset: _
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            p(b, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: d(()=>[
                                        p(m(H), {
                                            ref_key: "basicTableRef",
                                            ref: y,
                                            columns: m(g),
                                            actionColumn: m(R),
                                            request: (u)=>q(u, m(I)()),
                                            "row-key": (u)=>u.id,
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, null, 8, [
                                            "columns",
                                            "actionColumn",
                                            "request",
                                            "row-key"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Ae as default, __tla };
