removido bun
This commit is contained in:
parent
98bcbff6cf
commit
430ff53c68
26 changed files with 2086 additions and 371 deletions
48
dist-front/e-licencie/Alertas/funcoes_alertas.js
Normal file
48
dist-front/e-licencie/Alertas/funcoes_alertas.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import dayjs from "dayjs";
|
||||
import weekOfYear from "dayjs/plugin/weekOfYear";
|
||||
dayjs.extend(weekOfYear);
|
||||
const enviarHoje = (inter, data) => {
|
||||
const hoje = dayjs(data || void 0);
|
||||
if (!inter) return true;
|
||||
if (inter == "D") return true;
|
||||
if (inter == "M" && hoje.get("D") == 1) return true;
|
||||
if (inter == "S" && hoje.get("d") == 1) return true;
|
||||
if (inter == "S" && hoje.get("d") == 1 && hoje.week() % 2 == 1) return true;
|
||||
return false;
|
||||
};
|
||||
const intervalosTipos = (tipoEntrada, log) => {
|
||||
log.push(`intervalosTipos -> tipoEntrada:${tipoEntrada}`);
|
||||
const config = {
|
||||
M: {
|
||||
campo_situacao: "situacao_texto_30",
|
||||
prefixo_assunto: "(Previs\xE3o para os pr\xF3ximos 30 dias) ",
|
||||
tipo: "M",
|
||||
enviar_hoje: enviarHoje("M")
|
||||
},
|
||||
Q: {
|
||||
campo_situacao: "situacao_texto_15",
|
||||
prefixo_assunto: "(Previs\xE3o para os pr\xF3ximos 15 dias) ",
|
||||
tipo: "Q",
|
||||
enviar_hoje: enviarHoje("Q")
|
||||
},
|
||||
S: {
|
||||
campo_situacao: "situacao_texto_7",
|
||||
prefixo_assunto: "(Previs\xE3o para os pr\xF3ximos 7 dias) ",
|
||||
tipo: "S",
|
||||
enviar_hoje: enviarHoje("S")
|
||||
},
|
||||
D: {
|
||||
campo_situacao: "situacao_texto",
|
||||
prefixo_assunto: "",
|
||||
tipo: "D",
|
||||
enviar_hoje: enviarHoje("D")
|
||||
}
|
||||
};
|
||||
const { campo_situacao, enviar_hoje, prefixo_assunto, tipo } = config[tipoEntrada || "D"] || config.D;
|
||||
log.push(campo_situacao, prefixo_assunto, tipo, enviar_hoje ? "S" : "N");
|
||||
return { campo_situacao, prefixo_assunto, tipo, enviar_hoje };
|
||||
};
|
||||
export {
|
||||
enviarHoje,
|
||||
intervalosTipos
|
||||
};
|
||||
2
dist-front/e-licencie/Alertas/index.js
Normal file
2
dist-front/e-licencie/Alertas/index.js
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export * from "./funcoes_alertas";
|
||||
export * from "./tipos";
|
||||
9
dist-front/e-licencie/Alertas/tipos.js
Normal file
9
dist-front/e-licencie/Alertas/tipos.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const intervalosDosAlertas = {
|
||||
D: "Di\xE1rio",
|
||||
S: "Semanal, nas segundas-feira",
|
||||
Q: "Quinzenal, nas segundas-feira",
|
||||
M: "Mensal, primeiro dia de cada m\xEAs"
|
||||
};
|
||||
export {
|
||||
intervalosDosAlertas
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue