build
This commit is contained in:
parent
87309f5b39
commit
da828ddf4f
120 changed files with 2482 additions and 4328 deletions
|
|
@ -9,7 +9,7 @@ import type { z } from "zod"
|
|||
import type { zp_enviar_registros } from "../_enviar_registros"
|
||||
import { PREFIXO_PILAO, type zp_deletar_registros } from "../variaveis"
|
||||
|
||||
import type { visoes_pilao } from "../visoes/listaDeVisoes"
|
||||
import type { visoes_pilao, z_padroes } from "../visoes/listaDeVisoes"
|
||||
import type { tipo_pilao_api } from "./pilao-api.ts"
|
||||
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem"
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ class ClassPilao {
|
|||
|
||||
serieConsultar<T extends keyof typeof visoes_pilao>(
|
||||
tipoVisao: T,
|
||||
parametros: z.infer<(typeof visoes_pilao)[T]>,
|
||||
parametros: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
||||
) {
|
||||
const dados = async (): Promise<
|
||||
tipoResposta<tipoRetornoSerieconsulta<T>>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { z } from "zod"
|
||||
import type { visoes_pilao } from "../visoes/listaDeVisoes"
|
||||
import type { visoes_pilao, z_padroes } from "../visoes/listaDeVisoes"
|
||||
|
||||
export type tipoConstrutorPilao = { produto: string; conta: string }
|
||||
|
||||
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
||||
registros: any[]
|
||||
legenda: string
|
||||
serie: z.infer<(typeof visoes_pilao)[T]>
|
||||
serie: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,33 @@
|
|||
import { z } from "zod"
|
||||
import { z_filtro } from "../_serie_consultar"
|
||||
|
||||
export const z_contagem_em_barra_vertical = z.object({
|
||||
/** aplica a todas as consultas */
|
||||
export const z_padroes = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
})
|
||||
|
||||
export const z_contagem_em_barra_vertical = z.object({
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
})
|
||||
|
||||
export const z_soma_em_barra_vertical = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaSoma: z.string(),
|
||||
unidadeSoma: z.string().optional(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
})
|
||||
|
||||
export const z_contagem_em_pizza = z.object({
|
||||
tabela: z.string(),
|
||||
classes: z.string(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
})
|
||||
|
||||
export const z_tabela = z.object({
|
||||
tabela: z.string(),
|
||||
colunas: z.string().array(),
|
||||
coluna_ordem: z.string().optional(),
|
||||
direcao_ordem: z.enum(["asc", "desc", "1", "-1"]).optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
})
|
||||
|
||||
export const visoes_pilao = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { z } from "zod"
|
||||
import type { visoes_pilao } from "./listaDeVisoes"
|
||||
import type { visoes_pilao, z_padroes } from "./listaDeVisoes"
|
||||
|
||||
export const z_tipos_campos_reg_grafico = z.enum([
|
||||
"tabela",
|
||||
|
|
@ -17,12 +17,18 @@ export type tipo_estrutura_visao_grafico<T extends keyof typeof visoes_pilao> =
|
|||
/** Rotulo */
|
||||
rotulo: string
|
||||
/** Retorna a tabela Referente ao Registro */
|
||||
tabela: (_: z.infer<(typeof visoes_pilao)[T]>) => string
|
||||
tabela: (
|
||||
_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
||||
) => string
|
||||
/** Descrição */
|
||||
descricao: (_: z.infer<(typeof visoes_pilao)[T]>) => string
|
||||
descricao: (
|
||||
_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
||||
) => string
|
||||
/** Lista os campos e suas configurações */
|
||||
campos: {
|
||||
[c in keyof Required<z.infer<(typeof visoes_pilao)[T]>>]: {
|
||||
[c in keyof Required<
|
||||
z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>
|
||||
>]: {
|
||||
rotulo: string
|
||||
tipo_campo: z.infer<typeof z_tipos_campos_reg_grafico>
|
||||
order: number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue