...
![](/download/attachments/827983798/image-2024-3-1_15-29-28.png?version=1&modificationDate=1709317768377&api=v2)
![](/download/attachments/827983798/image-2024-3-1_15-34-35.png?version=1&modificationDate=1709318075397&api=v2)
...
02.03. Tabs
Utilizado o componente POUI Tabs (https://po-ui.io/documentation/po-tabs), que remete a identidade visual que os usuários estão acostumado a ver no ambiente Protheus para os eventos, principalmente para os eventos totalizadores.
Image Added
03. Back-end para o painel
Exemplo de API feito em TLPP onde foi criada a classe principal e seus métodos para retornar a informação de acordo com end-point requisitado pelo front.
...
Painel |
---|
borderColor | white |
---|
bgColor | black |
---|
titleColor | white |
---|
borderWidth | 0 |
---|
borderStyle | solid |
---|
|
MethodtotalizadorDetails() ClassTotalizador5503 LocaloJson := JsonObject():New() LocaloJsonAux LocaljQuery := JsonObject():New() LocalcRecno := "" LocalcQry := "" LocalcAliasProd := "" LocalcCodCat := ""
jQuery := oRest:getQueryRequest() cRecno := jQuery['RECNO']
T2M->(DbSetOrder(1)) T2Q->(DbSetOrder(1)) T2R->(DbSetOrder(1))
oJson['items'] := {}
cQry += " SELECT T2M_FILIAL, " cQry += " T2M_ID, " cQry += " T2M_VERSAO, " cQry += " T2M_CPFTRB, " cQry += " T2M_PERAPU, " cQry += " T2Q_MATRIC, " cQry += " T2Q_CODCAT, " cQry += " T2Q_ESTABE, " cQry += " T2R_TPVLR, " cQry += " T2R_VALOR " cQry += " FROM " + RetSqlName("T2M") + " T2M " cQry += " LEFT JOIN " + RetSqlName("T2Q") + " T2Q " cQry += " ON T2M_FILIAL = T2Q_FILIAL " cQry += " AND T2M_ID = T2Q_ID " cQry += " AND T2M_VERSAO = T2Q_VERSAO " cQry += " LEFT JOIN " + RetSqlName("T2R") + " T2R " cQry += " ON T2Q_FILIAL = T2R_FILIAL " cQry += " AND T2Q_ID = T2R_ID " cQry += " AND T2Q_VERSAO = T2R_VERSAO " cQry += " WHERE T2M.R_E_C_N_O_ = ? "
oStatement := FWPreparedStatement():New( ChangeQuery(cQry) ) oStatement:setString(1,cRecno)
cQry := oStatement:getFixQuery()
cAliasProd := MPSysOpenQuery(cQry)
While (cAliasProd)->(!EoF()) oJsonAux := JsonObject():New()
C87->(DbSetOrder(1)) C87->(MsSeek(xFilial("C87") + (cAliasProd)->T2Q_CODCAT)) cCodCat := C87->C87_CODIGO
oJsonAux['registration'] := AllTrim((cAliasProd)->T2Q_MATRIC) oJsonAux['category'] := cCodCat oJsonAux['originCategory'] := cCodCat oJsonAux['tpValorProcTrab'] := POSICIONE("T2T",3,xFilial("T2T")+(cAliasProd)->T2R_TPVLR,"T2T_CODIGO") oJsonAux['fgtsTot'] := (cAliasProd)->T2R_VALOR oJsonAux['perRef'] := '2023-12' oJsonAux['codCateg'] := '101' oJsonAux['tpValorProcTrab'] := '71' oJsonAux['dpsFgtsProcTrab'] := 100.00 oJsonAux['remFgtsSefip'] := 100.00 oJsonAux['dpsFgtsSefip'] := 100.00 oJsonAux['remFgtsDecAnt'] := 100.00 oJsonAux['dpsFgtsDecAnt'] := 100.00 oJsonAux['nrInsc'] := '53113791000122' oJsonAux['tpInsc'] := 'CNPJ'
Aadd(oJson['items'],oJsonAux) FreeObj(oJsonAux)
(cAliasProd)->(DbSkip()) End
(cAliasProd)->(DbCloseArea()) T2M->(DbCloseArea()) T2Q->(DbCloseArea()) T2R->(DbCloseArea()) FreeObj(oStatement)
ReturnoRest:SetResponse(oJson) |
...
04.
...
Links de consulta:
https://po-ui.io/documentation
...
Padronização para nomenclaturas no uso do TLPP
TLPP
TLPP x AdvPL