import http from "@/utils/request"
import tool from "@/utils/tool"
import common from "@/utils/common"

export default {
    getContentConfigFromStorgae: {
        name: "从缓存查询内容报告模板列表",
        post: async function () {
            var list = [];
            var contentConfigStorage = tool.data.get("ContentConfigStorage")
            if (contentConfigStorage && contentConfigStorage.length > 0) {
                list = contentConfigStorage;
            }
            else {
                var generalId = "0";
                var giagnosticEntry = "1";
                var customMeasure = "2";
                var generalMeasure = "3";
                list.push({Id: generalId, Key: "General", Value: "常规内容", IsDefault:true, ParentId: "", Children: [
                    {Id: "9pbbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientTable", Value: "患者表格", IsDefault:true, ParentId: generalId},
                    {Id: "90bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientId", Value: "病人ID", IsDefault:true, ParentId: generalId},
                    {Id: "91bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientName", Value: "姓名", IsDefault:true, ParentId: generalId},
                    {Id: "92bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientAge", Value: "年龄", IsDefault:true, ParentId: generalId},
                    {Id: "93bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientGender", Value: "性别", IsDefault:true, ParentId: generalId},
                    {Id: "94bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientPhoneNumber", Value: "手机号", IsDefault:true, ParentId: generalId},
                    {Id: "95bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientExamDate", Value: "检查日期", IsDefault:true, ParentId: generalId},
                    {Id: "96baa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientInspectionItems", Value: "检查项目", IsDefault:true, ParentId: generalId},
                    {Id: "97baa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientLMP", Value: "末次生理期", IsDefault:true, ParentId: generalId},
                    {Id: "98bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientGA", Value: "孕周", IsDefault:true, ParentId: generalId},
                    {Id: "99bbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientEDD", Value: "预产期", IsDefault:true, ParentId: generalId},
                    {Id: "9abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientPerfPhysician", Value: "申请医师", IsDefault:true, ParentId: generalId},
                    {Id: "9bbbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientInspectionSite", Value: "检查部位", IsDefault:true, ParentId: generalId},
                    {Id: "9bbbaa61-a91d-4399-a3f4-df29117d2d59", Key: "DiseaseName", Value: "疾病名称", IsDefault:true, ParentId: generalId},
                    {Id: "9bbbaa61-a91d-4399-a3f4-df29117d2d59", Key: "Conclusion", Value: "结论", IsDefault:true, ParentId: generalId},
                    {Id: "9cbbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientExaminationWay", Value: "检查途径", IsDefault:true, ParentId: generalId},
                    {Id: "9fbbaa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportImages", Value: "普通超声图像", IsDefault:true, ParentId: generalId},
                    {Id: "53545af1-59b7-41a8-9bd5-bdba1aaf9891", Key: "DigitalSignature", Value: "电子签名", IsDefault:true, ParentId: generalId},
                    {Id: "9a0baa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportOBGraph", Value: "产科图表", IsDefault:true, ParentId: generalId},
                    {Id: "9a1baa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportWorkSheet", Value: "测量工作表", IsDefault:true, ParentId: generalId},
                    {Id: "9a2baa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientCheckNumber", Value: "检查号", IsDefault:true, ParentId: generalId},
                    {Id: "9a3baa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientApplicationDepartment", Value: "申请科室", IsDefault:true, ParentId: generalId},
                    {Id: "9a4baa61-a91d-4399-a3f4-df29117d2d59", Key: "RecordId", Value: "记录ID", IsDefault:true, ParentId: generalId},
                    {Id: "9a5baa61-a91d-4399-a3f4-df29117d2d59", Key: "ExamId", Value: "考卷ID", IsDefault:true, ParentId: generalId},
                    {Id: "9a6baa61-a91d-4399-a3f4-df29117d2d59", Key: "UpdateTime", Value: "更新时间", IsDefault:true, ParentId: generalId},
                    {Id: "9a7baa61-a91d-4399-a3f4-df29117d2d59", Key: "CreateUserId", Value: "创建用户ID", IsDefault:true, ParentId: generalId},
                    {Id: "9b7baa61-a91d-4399-a3f4-df29117d2d59", Key: "CreateUserName", Value: "创建用户", IsDefault:true, ParentId: generalId},
                    {Id: "9c7baa61-a91d-4399-a3f4-df29117d2d59", Key: "CreateUserFirstName", Value: "创建用户姓", IsDefault:true, ParentId: generalId},
                    {Id: "9d7baa61-a91d-4399-a3f4-df29117d2d59", Key: "CreateUserLastName", Value: "创建用户名", IsDefault:true, ParentId: generalId},
                    {Id: "9e7baa61-a91d-4399-a3f4-df29117d2d59", Key: "CreateUserNickName", Value: "创建用户昵称", IsDefault:true, ParentId: generalId},
                    {Id: "9a8baa61-a91d-4399-a3f4-df29117d2d59", Key: "CreateTime", Value: "创建时间", IsDefault:true, ParentId: generalId},
                    {Id: "9a9baa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportType", Value: "报告类型", IsDefault:true, ParentId: generalId},
                    {Id: "9aabaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientBirthday", Value: "出生年月", IsDefault:true, ParentId: generalId},
                    {Id: "1abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientDeviceNumber", Value: "设备型号", IsDefault:true, ParentId: generalId},
                    {Id: "2abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientOutpatientNumber", Value: "门诊号", IsDefault:true, ParentId: generalId},
                    {Id: "3abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "PatientUltrasonicNumber", Value: "超声号", IsDefault:true, ParentId: generalId},
                    {Id: "4abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportTime", Value: "报告时间", IsDefault:true, ParentId: generalId},
                    {Id: "1acgaa61-a91d-4397-a3f4-df29144d2d55", Key: "ConsultationNumber", Value: "会诊编号", IsDefault:true, ParentId: generalId},
                    {Id: "5abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportPhysician", Value: "报告医师", IsDefault:true, ParentId: generalId},
                    {Id: "6abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "InspectionPhysician", Value: "检查医师", IsDefault:true, ParentId: generalId},
                    {Id: "26f81427-613d-456a-8a45-7af401d6943a", Key: "ScanPhysician", Value: "扫查医生", IsDefault:true, ParentId: generalId},
                    {Id: "7abbaa61-a91d-4399-a3f4-df29117d2d59", Key: "HospitalName", Value: "医院名称", IsDefault:true, ParentId: generalId},
                    {Id: "9E4D1A91-44D6-46AE-AF29-34FFCB6A34A9", Key: "HospitalDepartment", Value: "医院科室", IsDefault:true, ParentId: generalId},
                    {Id: "A8BF19D0-556C-4C32-B5CB-41EA30027505", Key: "HospitalAddress", Value: "医院地址", IsDefault:true, ParentId: generalId},
                    {Id: "48EE0F65-B86C-4591-BDAB-14D46EEB4C30", Key: "PerformingPhysician", Value: "主治医师", IsDefault:true, ParentId: generalId},
                    {Id: "BD4049E6-6847-46FA-A70E-991533BC67F7", Key: "ReferringPhysician", Value: "咨询医师", IsDefault:true, ParentId: generalId},
                    {Id: "877FAFEA-4E47-4E76-A93F-10950B9ABA1A", Key: "ObInfo", Value: "产科总结（US）", IsDefault:true, ParentId: generalId},
                    {Id: "CF8D47A2-B3F0-4BD7-B366-B1B44B63D82A", Key: "ZScore", Value: "Z评分", IsDefault:true, ParentId: generalId},
                    {Id: "157017B8-6FC5-4677-9818-605601D907AC", Key: "FetalBiophysicalScore", Value: "胎儿生理评分", IsDefault:true, ParentId: generalId},
                    {Id: "5347554A-084E-40AB-A7D4-941085B61A84", Key: "Follicle", Value: "卵泡测量", IsDefault:true, ParentId: generalId},
                    {Id: "B38D4CE8-5B1B-4432-8474-EDF70A3FF6CF", Key: "AutoFollicle", Value: "二维卵泡自动测量", IsDefault:true, ParentId: generalId},
                    {Id: "019EA88D-58F0-4639-809D-A5A524DADFC1", Key: "AutoFollicleImages", Value: "二维卵泡自动测量图像", IsDefault:true, ParentId: generalId},
                    {Id: "66A8781E-9F2B-42B9-997E-A40BDA3C3728", Key: "AutoFollicle3D", Value: "三维卵泡自动测量", IsDefault:true, ParentId: generalId},
                    {Id: "0E696819-AE15-4AC4-81A4-645A2F53F958", Key: "AutoFollicle3DImages", Value: "三维卵泡自动测量图像", IsDefault:true, ParentId: generalId},
                    {Id: "5195679C-ED36-4C9E-8106-7B1CD9C181C9", Key: "AutoOvary", Value: "卵巢自动测量", IsDefault:true, ParentId: generalId},
                    {Id: "DBECDD4C-5080-4EA5-A2A7-1A7A2FCAC2A9", Key: "AutoOvaryImages", Value: "卵巢自动测量图像", IsDefault:true, ParentId: generalId},
                    {Id: "5B810BC6-6101-4F90-83CE-D31BDE97A07B", Key: "WMS", Value: "室壁运动评分", IsDefault:true, ParentId: generalId},
                    {Id: "3B466E45-070E-41DF-A00D-D96D5797C85F", Key: "StrainRate", Value: "应变分析", IsDefault:true, ParentId: generalId},
                    {Id: "DFB8A17B-310D-4B14-9F4F-A16E2F500084", Key: "ReproSummary", Value: "生殖总结（US）", IsDefault:true, ParentId: generalId},
                    {Id: "F46A48B1-96BB-475E-8EF7-5CBFF22AAECB", Key: "GestationalAgeOriginDescription", Value: "孕龄来源描述", IsDefault:true, ParentId: generalId},
                    {Id: "9569465B-FCCB-4E04-8B6B-D4624224722D", Key: "GestationalAgeOriginValue", Value: "孕龄来源数值", IsDefault:true, ParentId: generalId},
                    {Id: "DB1202FB-51DF-4EB7-903A-2F6740CAD74B", Key: "Owner", Value: "主人", IsDefault:true, ParentId: generalId},
                    {Id: "FC5F7564-B63F-4185-8E1C-FC4BC5046332", Key: "Species", Value: "种类", IsDefault:true, ParentId: generalId},
                    {Id: "B7631C99-706A-48D8-A6DF-1C11F90106C9", Key: "Breed", Value: "品种", IsDefault:true, ParentId: generalId},
                    {Id: "4D916526-9947-4EDE-8630-337632A35627", Key: "FetusA", Value: "胎儿A", IsDefault:true, ParentId: generalId},
                    {Id: "B5A2AAE5-4DDB-4945-9515-82DB367B04F2", Key: "FetusB", Value: "胎儿B", IsDefault:true, ParentId: generalId},
                    {Id: "35C22E6B-D15E-43CD-88F9-99AA79C3575D", Key: "FetusC", Value: "胎儿C", IsDefault:true, ParentId: generalId},
                    {Id: "24498307-BB99-458B-8EC0-AC8434DE491D", Key: "FetusD", Value: "胎儿D", IsDefault:true, ParentId: generalId},
                    {Id: "AEC6FDB6-1CD4-4C43-896A-2E914B837545", Key: "FetusE", Value: "胎儿E", IsDefault:true, ParentId: generalId},
                    {Id: "9556EA12-CFB3-4AD5-8717-1057D1D5A3EE", Key: "PatientHeight", Value: "身高", IsDefault:true, ParentId: generalId},
                    {Id: "0003B8C3-397C-4688-985D-55B757E3855D", Key: "PatientWeight", Value: "体重", IsDefault:true, ParentId: generalId},
                    {Id: "5AAC30D9-FCE3-4FD0-998C-3A9E2D54F312", Key: "BSA", Value: "体表面积", IsDefault:true, ParentId: generalId},
                    {Id: "EA33699C-E86D-497B-A9A9-B8AFAF4A11C7", Key: "AB", Value: "堕胎次数", IsDefault:true, ParentId: generalId},
                    {Id: "5B2BF3CE-62B2-4BE8-8685-29DB9A62465B", Key: "Ectopic", Value: "宫外孕", IsDefault:true, ParentId: generalId},
                    {Id: "04FA2451-BDD0-45E4-931B-3D01E95123E0", Key: "Gravida", Value: "妊娠", IsDefault:true, ParentId: generalId},
                    {Id: "96C987B0-D0C3-445B-BD45-CB10A276E6D7", Key: "Para", Value: "产史", IsDefault:true, ParentId: generalId},
                    {Id: "3969C8BE-7715-4423-919E-51D6EBEBFA8E", Key: "PSA", Value: "前列腺特异抗原", IsDefault:true, ParentId: generalId},
                    {Id: "C64CC111-3557-4B29-ACBF-678816235694", Key: "PPSACoefficient", Value: "前列腺特异抗原启动子系数", IsDefault:true, ParentId: generalId},
                    {Id: "91D8F2DE-331F-49E5-95C0-1AEF9D566185", Key: "BMI", Value: "身体质量指数", IsDefault:true, ParentId: generalId},
                    {Id: "33D46E3F-A089-4B0A-8D1D-F4C7556BD62D", Key: "HR", Value: "心率", IsDefault:true, ParentId: generalId},
                    {Id: "EFB98909-D077-4650-9235-B4C9EA111BA3", Key: "SBP", Value: "收缩压", IsDefault:true, ParentId: generalId},
                    {Id: "BFEE3EE4-E98E-4981-9A55-80761F3903CD", Key: "DBP", Value: "舒张压", IsDefault:true, ParentId: generalId},
                    {Id: "5E0FFEF1-1A67-44D2-BF3D-527F27FCC171", Key: "FetusNumber", Value: "胎儿数目", IsDefault:true, ParentId: generalId},
                    {Id: "0FC1FC7D-2D87-4C6C-A54B-3033B8DB922B", Key: "Operator", Value: "操作者", IsDefault:true, ParentId: generalId},
                    {Id: "B57E11C6-1DA4-4119-810D-F823AB42D86D", Key: "SecondId", Value: "副ID", IsDefault:true, ParentId: generalId},
                    {Id: "21B58982-52C6-4F79-B9B2-57BD109F42A1", Key: "AccessionNumber", Value: "流水号", IsDefault:true, ParentId: generalId},
                    {Id: "43D40A8E-16FA-4528-B69D-C160F9B24AD5", Key: "PatientUniqueCode", Value: "姓名或ID", IsDefault:true, ParentId: generalId},
                    {Id: "12340A8E-16FA-4528-B69D-C160F9B24AD5", Key: "History", Value: "病史", IsDefault:true, ParentId: generalId},
                    {Id: "CD340A8E-16FA-4321-B69D-C140F9F24AD5", Key: "PatientPresentation", Value: "患者表述", IsDefault:true, ParentId: generalId},
                    {Id: "CD340A5E-16FA-4321-B79D-C14012F24AD5", Key: "PatientInspectionSiteSingle", Value: "检查部位(单个)", IsDefault:true, ParentId: generalId},
                    {Id: "11340A5E-15FA-4321-B79D-C13212F24AD5", Key: "AIIndexFlag", Value: "AI Index", IsDefault:true, ParentId: generalId},
                    {Id: "2340A5E-16FA-4321-B79D-C14412F24AD5", Key: "EditReporttime", Value: "报告编辑时间", IsDefault:true, ParentId: generalId},
                    {Id: "A2340A5E-16FA-4321-B79D-C14412F24AD5", Key: "ContactAddress", Value: "通讯地址", IsDefault:true, ParentId: generalId},
                    {Id: "B2340A5E-16FA-4321-B79D-C14412F24AD5", Key: "PatientSource", Value: "病人来源", IsDefault:true, ParentId: generalId},
                    {Id: "C2340A5E-16FA-4321-B79D-C14412F24AD5", Key: "ADNumber", Value: "住院号", IsDefault:true, ParentId: generalId},
                    {Id: "D2340A5E-16FA-4321-B79D-C14412F24AD5", Key: "BedNumber", Value: "床号", IsDefault:true, ParentId: generalId},
                    {Id: "E2340A5E-16FA-4321-B79D-C14412F24AD5", Key: "ExamType", Value: "检查类型", IsDefault:true, ParentId: generalId},
                    {Id: "F2340A5E-16FA-4321-B79D-C14412F24AD5", Key: "InspectionDepartment", Value: "检查科室", IsDefault:true, ParentId: generalId},
                    {Id: "F4340A5E-16FA-4521-B79D-C14412F24AD5", Key: "LeftTumor", Value: "左肿物", IsDefault:true, ParentId: generalId},
                    {Id: "F4340A5E-16FA-A321-B79D-C14412F24AD5", Key: "RightTumor", Value: "右肿物", IsDefault:true, ParentId: generalId}
                ]});
                list.push({Id: giagnosticEntry, Key: "DiagnosticEntry", Value: "诊断词条", IsDefault:true, ParentId: "", Children: [
                    {Id: "9dbbaa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportDescription", Value: "超声描述", IsDefault:true, ParentId: giagnosticEntry},
                    {Id: "9ebbaa61-a91d-4399-a3f4-df29117d2d59", Key: "ReportSummary", Value: "超声提示", IsDefault:true, ParentId: giagnosticEntry}
                ]});
                list.push({Id: customMeasure, Key: "CommonMeasure", Value: "自定义测量(仅超声机用)", IsDefault:true, ParentId: "", Children: [] });
                list.push({Id: generalMeasure, Key: "OtherMeasure", Value: "常用测量(仅超声机用)", IsDefault:true, ParentId: "", Children: [] });
                tool.data.set("ContentConfigStorage", list);
            }
            return list;
        }
    },
    findContentConfigAsync: {
		name: "查询内容报告模板",
        post: async function (model) {
            var list = [];
            var parentCode = "";
            if (model && model.code && model.code.length > 0)
            {
                parentCode = model.code;
            }
            var allList = [];
            var contentConfigStorage = tool.data.get("ContentConfigStorage")
            if (contentConfigStorage && contentConfigStorage.length > 0) {
                allList = contentConfigStorage;
            }
            if (allList && allList.length > 0) {
                if (parentCode.length <= 0) {
                    allList.forEach(c => {
                        if (c.ParentId === "") {
                            list.push({ Id: c.Id, Key: c.Key, Value: c.Value, ParentId: "", IsDefault: c.IsDefault });
                        }
                    });
                }
                else {
                    allList.some(d => {
                        if (d.ParentId === "" && d.Key === parentCode) {
                            if (d.Children && d.Children.length > 0) {
                                d.Children.forEach(e => {
                                    list.push({ Id: e.Id, Key: e.Key, Value: e.Value, ParentId: e.ParentId, IsDefault: e.IsDefault });
                                });
                            }
                        }
                    });
                }
            }
            return list;
        }
    },
    findDefaultDynamicDataAsync:
    {
        name: "Find Report Designer Default Dynamic Data",
        post: async function () {
            var list = [];
            list.push({ Id: common.guid(), Key: 'DynamicOption1', Value: "reportDesigner.DynamicOption1" });
            list.push({ Id: common.guid(), Key: 'DynamicOption2', Value: "reportDesigner.DynamicOption2" });
            list.push({ Id: common.guid(), Key: 'DynamicOption3', Value: "reportDesigner.DynamicOption3" });
            list.push({ Id: common.guid(), Key: 'DynamicOptionOther', Value: "reportDesigner.DynamicOptionOther" });
            return list;
        }
    },
    findMeasureConfigAsync: {
		name: "查询计算项报告模板",
        post: async function (code) {
            var list = [];
            var allList = [];
            var contentConfigStorage = tool.data.get("ContentConfigStorage")
            if (contentConfigStorage && contentConfigStorage.length > 0) {
                allList = contentConfigStorage;
            }
            if (allList && allList.length > 0) {
                list = allList.filter(d => d.Key === code)[0].Children;
            }
            return list;
        }
    },
    getDateModuleOptionsAsync: {
		name: "获取时间控件选项列表",
		post: async function () {
            var result = [
                { Key: "yyyy-MM-dd", Value: tool.dateFormat(Date.now(), "yyyy-MM-dd") },
                { Key: "yyyy/MM/dd", Value: tool.dateFormat(Date.now(), "yyyy/MM/dd") },
                { Key: "yyyy.MM.dd", Value: tool.dateFormat(Date.now(), "yyyy.MM.dd") },
                { Key: "yyyy年MM月dd日", Value: tool.dateFormat(Date.now(), "yyyy年MM月dd日") },
                { Key: "yyyy-MM-dd hh:mm", Value: tool.dateFormat(Date.now(), "yyyy-MM-dd hh:mm") },
                { Key: "yyyy年MM月dd日 hh:mm", Value: tool.dateFormat(Date.now(), "yyyy年MM月dd日 hh:mm") },
            ];
            return result;
        }
	},
	getFeatureTagAsync: {
		name: "获取功能标签信息",
		post: async function () {
            var result = [
                { Key: "SpeechInput", Value: "reportDesigner.SpeechInput" },
                { Key: "MeasuringResult", Value: "reportDesigner.MeasuringResult" },
            ];
            return result;
        }
	},
    saveContentConfigToStorage: {
        name: "保存模板内容配置信息",
        post: async function (data, isEdit) {
            if (data && data.Id && data.Id.length > 0) {
                var contentConfigStorage = tool.data.get("ContentConfigStorage");
                if (isEdit) {
                    if (data.ParentId >= 0 || data.ParentId.length > 0) {
                        var curConfigEditList = contentConfigStorage.filter(c => c.Id === data.ParentId);
                        if (curConfigEditList && curConfigEditList.length > 0)
                        {
                            var curConfigEditInfo = curConfigEditList[0];
                            if (curConfigEditInfo.Children && curConfigEditInfo.Children.length > 0) {
                                var result = curConfigEditInfo.Children.some(d => {
                                    if (d.Id != data.Id && (d.Key === data.Key || d.Value === data.Value)) {
                                        return true;
                                    }
                                });
                                if (result) {
                                    return false;
                                }
                                curConfigEditInfo.Children.some(e => {
                                    if (e.Id === data.Id) {
                                        e.Key = data.Key;
                                        e.Value = data.Value
                                        return true;
                                    }
                                });
                            }
                        }
                    }
                }
                else {
                    if (data.ParentId >= 0 || data.ParentId.length > 0) {
                        var curConfigList = contentConfigStorage.filter(c => c.Id === data.ParentId);
                        if (curConfigList && curConfigList.length > 0)
                        {
                            var curConfigInfo = curConfigList[0];
                            if (curConfigInfo.Children && curConfigInfo.Children.length > 0)
                            {
                                var res = curConfigInfo.Children.some(d => {
                                    if (d.Key === data.Key || d.Value === data.Value) {
                                        return true;
                                    }
                                });
                                if (res) {
                                    return false;
                                }
                                else {
                                    curConfigInfo.Children.push(data);
                                }
                            }
                            else{
                                curConfigInfo.Children.push(data);
                            }
                        }
                    }
                }
                tool.data.set("ContentConfigStorage", contentConfigStorage);
                return true;
            }
            return false;
        }
    },
    deleteContentConfigToStorage: {
        name: "保存模板内容配置信息",
        post: async function (data) {
            if (data && data.Id && data.Id.length > 0) {
                var contentConfigStorage = tool.data.get("ContentConfigStorage");
                contentConfigStorage.forEach(c => {
                    if (c.Children && c.Children.length > 0) {
                        var info = c.Children.filter(d => d.Id === data.Id);
                        c.Children.splice(c.Children.indexOf(info), 1)
                    }
                });
                tool.data.set("ContentConfigStorage", contentConfigStorage);
                return true;
            }
            return false;
        }
    },
    getPageNumberList: {
		name: "获取页脚显示选择",
		post: async function () {
            var result = [
                { Key: "Number", Value: "页码：1, 2..." },
                { Key: "NumberAndTotalNumber", Value: "页码：1/2, 2/2..." },
                { Key: "StaticText", Value: "固定文本" }
            ];
            return result;
        }
	},
    updateReportTemplateAsync: {
		method: 'UpdateReportTemplateAsync',
		name: "保存报告模板",
		post: async function (datas) {
            var data = {
                Data: datas
            }
            return await http.post(this.method, data);
        }
	},
    getReportTemplateAsync: {
		method: 'GetReportTemplateAsync',
		name: "获取报告模板详情",
		post: async function (data) {
            return await http.post(this.method, data);
        }
	},
}
