export const defalutModalForm = { taskName: "", //任务名称 priority: "", //优先级 taskType: 0, // 任务类型 customId: null, // 客户id 0 businessOpportunityId: null, //商机id 1 orderId: null, // 订单id 2 clueId: null, //线索id 3 contactsId: null, //联系人id executorId: null, //执行人id isRepeat: 0, //是否重复 repeatType: 0, //重复类型 endType: 1, //结束类型 repeatEndNever: 1, repeatEndCount: null, //重复指定次数次数后结束 repeatEndDate: null, //重复到指定日期后结束 repeatDesignDay: null, //自定义日期 repeatDesignSameday: null, //自定义周期 startDate: "", //开始日期 endDate: "", //截止日期 taskDesc: "", //任务描述 taskLogs: [], }; export const PRIORITY = [ //优先级 { label: "高", value: 0 }, { label: "中", value: 1 }, { label: "低", value: 2 }, ]; export const TASK_TYPE = [ // 弹窗任务类型 { label: "客户", value: 0, show: true }, { label: "商机", value: 1, show: true }, { label: "销售订单", value: 2, show: true }, { label: "线索", value: 3, show: false }, ]; export const TASK_TYPE_FIELD: { type: string; field: "customId" | "businessOpportunityId" | "orderId" | "clueId"; valueIndex: string; labelIndex: string; }[] = [ { type: "0", field: "customId", valueIndex: "id", labelIndex: "customName", }, { type: "1", field: "businessOpportunityId", valueIndex: "id", labelIndex: "name", }, { type: "2", field: "orderId", valueIndex: "value", labelIndex: "label", }, { type: "3", field: "clueId", valueIndex: "id", labelIndex: "clueName", }, ]; export const REPEAT_TYPE = [ { label: "每天", value: 0 }, { label: "每周", value: 1 }, { label: "每月", value: 2 }, { label: "自定义周期", value: 3 }, { label: "自定义日期", value: 4 }, ]; export const defaultGenerateFormData = { list: [], config: {}, }; export const propertyToTaskTypeMap = { customId: 0, businessOpportunityId: 1, orderId: 2, clueId: 3, }; export const propertyToEndTypeMap = {}; /** * 获取任务类型的函数 * * @param obj 任意对象,期望该对象包含特定的属性以确定任务类型 * @returns 返回匹配到的任务类型值,如果没有匹配则返回null */ export function getTaskType(obj: any) { if (!obj) { return } if (obj.taskType) { return obj.taskType; } let taskType = null; for (const [property, taskTypeValue] of Object.entries( propertyToTaskTypeMap )) { if (obj.hasOwnProperty(property)) { taskType = taskTypeValue; break; } } return taskType; } export const CUSTOMER_FORM_URL = "/sys-form/getListByCode/tasks"; //自定义form表单 export const ALL_CUSTOM = "/custom/getAll"; //客户 export const ALL_CLUE = "/clue/getAll"; //线索 export const ALL_BUSINESS = "/business-opportunity/getAll"; //商机 export const ALL_CONTACTS = "/contacts/allContacts"; //联系人 export const ALL_USERS = "/user/getSimpleActiveUserList"; //获取所有人 export const ALL_ORDERS = "/order/list"//销售订单