import { gL as i, V as d, bk as p, l as a, __tla as __tla_0 } from "./index-9PRMimni.js";
import { i as u } from "./isEmpty-BUg1OsQj.js";
let T, b;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    b = async function() {
        return await i("sms_file_status");
    };
    const { t: e } = d(), l = p(), F = await b();
    T = function(t = {}) {
        const n = [
            {
                field: "code",
                component: "NSelect",
                label: e("mdm.smsFormsTemplate.smsFileCode"),
                componentProps: {
                    labelField: "code",
                    valueField: "code",
                    options: t.templateList,
                    filterable: !0
                }
            },
            {
                field: "name",
                component: "NInput",
                label: e("mdm.smsFormsTemplate.smsFileName")
            },
            {
                field: "createDate",
                label: e("mdm.smsFormsTemplate.createDate"),
                component: "NDatePicker",
                componentProps: {
                    type: "daterange",
                    valueFormat: "yyyy-MM-dd"
                }
            },
            {
                field: "status",
                label: e("mdm.smsFormsTemplate.status"),
                component: "NSelect",
                componentProps: {
                    options: F,
                    labelField: l.getLocale === "en" ? "labelEn" : "label"
                }
            },
            {
                field: "type",
                component: "BasicSelect",
                label: e("mdm.smsFormsTemplate.fileType"),
                componentProps: ()=>({
                        cacheKey: "sms_template_type",
                        block: !0,
                        cache: !1,
                        labelField: l.getLocale === "en" ? "labelEn" : "label"
                    })
            }
        ], r = [
            {
                field: "code",
                component: "NSelect",
                label: e("mdm.smsFormsTemplate.smsFileCode"),
                componentProps: ({ model: m })=>({
                        labelField: "code",
                        valueField: "code",
                        options: a(t.templateList),
                        filterable: !0,
                        onUpdateValue: (s, o)=>{
                            t?.handleChangeTemplate(m, o);
                        }
                    }),
                rules: [
                    {
                        required: !0,
                        message: `${e("common.chooseText")} ${e("mdm.smsFormsTemplate.smsFileCode")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "_name_",
                component: "NSelect",
                label: e("mdm.smsFormsTemplate.smsFileName"),
                componentProps: ({ model: m })=>({
                        labelField: l.getLocale === "en" ? "nameEn" : "nameCn",
                        valueField: "code",
                        options: a(t.templateList),
                        filterable: !0,
                        onUpdateValue: (s, o)=>{
                            t?.handleChangeTemplate(m, o);
                        }
                    }),
                rules: [
                    {
                        required: !0,
                        message: `${e("common.chooseText")} ${e("mdm.smsFormsTemplate.smsFileName")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "version",
                component: "NInput",
                label: e("mdm.smsFormsTemplate.smsFileVersion"),
                componentProps: {
                    disabled: !0
                }
            },
            {
                field: "type",
                component: "BasicSelect",
                label: e("mdm.smsFormsTemplate.fileType"),
                componentProps: {
                    cacheKey: "sms_template_type",
                    block: !0,
                    cache: !1,
                    disabled: !0,
                    labelField: l.getLocale === "en" ? "labelEn" : "label"
                }
            },
            {
                field: "url",
                label: e("mdm.smsFormsTemplate.fileUrl"),
                slot: "fileSlot",
                giProps: {
                    span: 5
                }
            }
        ], c = [
            {
                field: "url",
                hidden: !0
            },
            {
                field: "fileCode",
                hidden: !0
            },
            {
                field: "code",
                component: "NInput",
                label: e("mdm.smsFormsTemplate.smsFileCode"),
                componentProps: {
                    disabled: !0
                }
            },
            {
                field: l.getLocale === "en" ? "nameEn" : "nameCn",
                component: "NInput",
                label: e("mdm.smsFormsTemplate.smsFileName"),
                componentProps: {
                    disabled: !0
                }
            },
            {
                field: "type",
                component: "BasicSelect",
                label: e("mdm.smsFormsTemplate.fileType"),
                componentProps: {
                    cacheKey: "sms_template_type",
                    block: !0,
                    disabled: !0,
                    cache: !1,
                    labelField: l.getLocale === "en" ? "labelEn" : "label"
                }
            },
            {
                field: "version",
                component: "NInput",
                label: e("mdm.smsFormsTemplate.smsFileVersion"),
                componentProps: {
                    disabled: !0
                }
            },
            {
                field: "url",
                label: e("mdm.smsFormsTemplate.fileUrl"),
                slot: "fileSlot",
                giProps: {
                    span: 5
                },
                rules: [
                    {
                        required: !0,
                        validator: (m, s)=>(console.log(s), u(s) ? new Error(`${e("common.chooseText")} ${e("mdm.smsFormsTemplate.fileUrl")}`) : !0),
                        trigger: [
                            "change"
                        ]
                    }
                ]
            }
        ];
        return {
            addSchemas: r,
            editSchemas: c,
            searchSchemas: n
        };
    };
});
export { T as c, b as g, __tla };
