Criação da página de relatórios e conexão com endpoint de get e post
This commit is contained in:
parent
fe455a256a
commit
92c84e7f2d
179
package-lock.json
generated
179
package-lock.json
generated
@ -20,6 +20,7 @@
|
|||||||
"bootstrap-icons": "^1.13.1",
|
"bootstrap-icons": "^1.13.1",
|
||||||
"dayjs": "^1.11.18",
|
"dayjs": "^1.11.18",
|
||||||
"flatpickr": "^4.6.13",
|
"flatpickr": "^4.6.13",
|
||||||
|
"html2pdf.js": "^0.12.1",
|
||||||
"lucide-react": "^0.543.0",
|
"lucide-react": "^0.543.0",
|
||||||
"perfect-scrollbar": "^1.5.6",
|
"perfect-scrollbar": "^1.5.6",
|
||||||
"powershell": "^2.3.3",
|
"powershell": "^2.3.3",
|
||||||
@ -18118,6 +18119,12 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/pako": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/pako/-/pako-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@types/parse-json": {
|
"node_modules/@types/parse-json": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz",
|
||||||
@ -18163,6 +18170,13 @@
|
|||||||
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==",
|
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==",
|
||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause"
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/raf": {
|
||||||
|
"version": "3.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz",
|
||||||
|
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"node_modules/@types/range-parser": {
|
"node_modules/@types/range-parser": {
|
||||||
"version": "1.2.7",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||||
@ -19593,6 +19607,15 @@
|
|||||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/base64-arraybuffer": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/batch": {
|
"node_modules/batch": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz",
|
||||||
@ -19965,6 +19988,26 @@
|
|||||||
],
|
],
|
||||||
"license": "CC-BY-4.0"
|
"license": "CC-BY-4.0"
|
||||||
},
|
},
|
||||||
|
"node_modules/canvg": {
|
||||||
|
"version": "3.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.11.tgz",
|
||||||
|
"integrity": "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.12.5",
|
||||||
|
"@types/raf": "^3.4.0",
|
||||||
|
"core-js": "^3.8.3",
|
||||||
|
"raf": "^3.4.1",
|
||||||
|
"regenerator-runtime": "^0.13.7",
|
||||||
|
"rgbcolor": "^1.0.1",
|
||||||
|
"stackblur-canvas": "^2.0.0",
|
||||||
|
"svg-pathdata": "^6.0.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/case-sensitive-paths-webpack-plugin": {
|
"node_modules/case-sensitive-paths-webpack-plugin": {
|
||||||
"version": "2.4.0",
|
"version": "2.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz",
|
||||||
@ -21088,6 +21131,15 @@
|
|||||||
"postcss": "^8.4"
|
"postcss": "^8.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/css-line-break": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"utrie": "^1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/css-loader": {
|
"node_modules/css-loader": {
|
||||||
"version": "6.11.0",
|
"version": "6.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.11.0.tgz",
|
||||||
@ -22014,6 +22066,16 @@
|
|||||||
"url": "https://github.com/fb55/domhandler?sponsor=1"
|
"url": "https://github.com/fb55/domhandler?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dompurify": {
|
||||||
|
"version": "3.2.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.7.tgz",
|
||||||
|
"integrity": "sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==",
|
||||||
|
"license": "(MPL-2.0 OR Apache-2.0)",
|
||||||
|
"optional": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@types/trusted-types": "^2.0.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/domutils": {
|
"node_modules/domutils": {
|
||||||
"version": "2.8.0",
|
"version": "2.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
|
||||||
@ -23229,6 +23291,17 @@
|
|||||||
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
|
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/fast-png": {
|
||||||
|
"version": "6.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-png/-/fast-png-6.4.0.tgz",
|
||||||
|
"integrity": "sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/pako": "^2.0.3",
|
||||||
|
"iobuffer": "^5.3.2",
|
||||||
|
"pako": "^2.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/fast-uri": {
|
"node_modules/fast-uri": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
|
||||||
@ -23275,6 +23348,12 @@
|
|||||||
"bser": "2.1.1"
|
"bser": "2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fflate": {
|
||||||
|
"version": "0.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
|
||||||
|
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/file-entry-cache": {
|
"node_modules/file-entry-cache": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||||
@ -24525,6 +24604,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/html2canvas": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"css-line-break": "^2.1.0",
|
||||||
|
"text-segmentation": "^1.0.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/html2pdf.js": {
|
||||||
|
"version": "0.12.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/html2pdf.js/-/html2pdf.js-0.12.1.tgz",
|
||||||
|
"integrity": "sha512-3rBWQ96H5oOU9jtoz3MnE/epGi27ig9h8aonBk4JTpvUERM3lMRxhIRckhJZEi4wE0YfRINoYOIDY0hLY0CHgQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"html2canvas": "^1.0.0",
|
||||||
|
"jspdf": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/htmlparser2": {
|
"node_modules/htmlparser2": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
|
||||||
@ -24849,6 +24951,12 @@
|
|||||||
"loose-envify": "^1.0.0"
|
"loose-envify": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/iobuffer": {
|
||||||
|
"version": "5.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/iobuffer/-/iobuffer-5.4.0.tgz",
|
||||||
|
"integrity": "sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/ipaddr.js": {
|
"node_modules/ipaddr.js": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz",
|
||||||
@ -26609,6 +26717,23 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jspdf": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/jspdf/-/jspdf-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-eURjAyz5iX1H8BOYAfzvdPfIKK53V7mCpBTe7Kb16PaM8JSXEcUQNBQaiWMI8wY5RvNOPj4GccMjTlfwRBd+oQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.26.9",
|
||||||
|
"fast-png": "^6.2.0",
|
||||||
|
"fflate": "^0.8.1"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"canvg": "^3.0.11",
|
||||||
|
"core-js": "^3.6.0",
|
||||||
|
"dompurify": "^3.2.4",
|
||||||
|
"html2canvas": "^1.0.0-rc.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/jsx-ast-utils": {
|
"node_modules/jsx-ast-utils": {
|
||||||
"version": "3.3.5",
|
"version": "3.3.5",
|
||||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz",
|
||||||
@ -28473,6 +28598,12 @@
|
|||||||
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
|
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
|
||||||
"license": "BlueOak-1.0.0"
|
"license": "BlueOak-1.0.0"
|
||||||
},
|
},
|
||||||
|
"node_modules/pako": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
|
||||||
|
"license": "(MIT AND Zlib)"
|
||||||
|
},
|
||||||
"node_modules/param-case": {
|
"node_modules/param-case": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
|
||||||
@ -31496,6 +31627,16 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/rgbcolor": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
|
||||||
|
"license": "MIT OR SEE LICENSE IN FEEL-FREE.md",
|
||||||
|
"optional": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8.15"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/rimraf": {
|
"node_modules/rimraf": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||||
@ -32375,6 +32516,16 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/stackblur-canvas": {
|
||||||
|
"version": "2.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz",
|
||||||
|
"integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.1.14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/stackframe": {
|
"node_modules/stackframe": {
|
||||||
"version": "1.3.4",
|
"version": "1.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz",
|
||||||
@ -32934,6 +33085,16 @@
|
|||||||
"integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==",
|
"integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/svg-pathdata": {
|
||||||
|
"version": "6.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz",
|
||||||
|
"integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/svgo": {
|
"node_modules/svgo": {
|
||||||
"version": "1.3.2",
|
"version": "1.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz",
|
||||||
@ -33255,6 +33416,15 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/text-segmentation": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"utrie": "^1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/text-table": {
|
"node_modules/text-table": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||||
@ -33965,6 +34135,15 @@
|
|||||||
"node": ">= 0.4.0"
|
"node": ">= 0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/utrie": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"base64-arraybuffer": "^1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/uuid": {
|
"node_modules/uuid": {
|
||||||
"version": "8.3.2",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
"bootstrap-icons": "^1.13.1",
|
"bootstrap-icons": "^1.13.1",
|
||||||
"dayjs": "^1.11.18",
|
"dayjs": "^1.11.18",
|
||||||
"flatpickr": "^4.6.13",
|
"flatpickr": "^4.6.13",
|
||||||
|
"html2pdf.js": "^0.12.1",
|
||||||
"lucide-react": "^0.543.0",
|
"lucide-react": "^0.543.0",
|
||||||
"perfect-scrollbar": "^1.5.6",
|
"perfect-scrollbar": "^1.5.6",
|
||||||
"powershell": "^2.3.3",
|
"powershell": "^2.3.3",
|
||||||
|
|||||||
164
src/PagesMedico/DoctorRelatorioManager.jsx
Normal file
164
src/PagesMedico/DoctorRelatorioManager.jsx
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
import API_KEY from '../components/utils/apiKeys';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import {useState, useEffect} from 'react'
|
||||||
|
import { useAuth } from '../components/utils/AuthProvider';
|
||||||
|
import { GetPatientByID } from '../components/utils/Functions-Endpoints/Patient';
|
||||||
|
const DoctorRelatorioManager = () => {
|
||||||
|
const {getAuthorizationHeader} = useAuth();
|
||||||
|
let authHeader = getAuthorizationHeader()
|
||||||
|
const [RelatoriosFiltrados, setRelatorios] = useState([])
|
||||||
|
const [PacientesComRelatorios, setPacientesComRelatorios] = useState([])
|
||||||
|
|
||||||
|
useEffect( () => {
|
||||||
|
let pacientesDosRelatorios =[]
|
||||||
|
|
||||||
|
|
||||||
|
const ListarPacientes = async () => {
|
||||||
|
for (let i = 0; i < RelatoriosFiltrados.length; i++) {
|
||||||
|
let relatorio = RelatoriosFiltrados[i];
|
||||||
|
let paciente_id = relatorio.patient_id;
|
||||||
|
const paciente = await GetPatientByID(paciente_id, authHeader);
|
||||||
|
console.log(paciente)
|
||||||
|
if (paciente.length > 0) {
|
||||||
|
pacientesDosRelatorios.push(paciente[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
setPacientesComRelatorios(pacientesDosRelatorios);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ListarPacientes()
|
||||||
|
console.log(PacientesComRelatorios, 'aqui')
|
||||||
|
|
||||||
|
}, [RelatoriosFiltrados]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
var myHeaders = new Headers();
|
||||||
|
myHeaders.append("apikey", API_KEY);
|
||||||
|
myHeaders.append("Authorization", authHeader);
|
||||||
|
|
||||||
|
var requestOptions = {
|
||||||
|
method: 'GET',
|
||||||
|
headers: myHeaders,
|
||||||
|
redirect: 'follow'
|
||||||
|
};
|
||||||
|
|
||||||
|
fetch("https://yuanqfswhberkoevtmfr.supabase.co/rest/v1/reports?patient_id&status", requestOptions)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => { setRelatorios(data); console.log(data) })
|
||||||
|
.catch(error => console.log('error', error));
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div className="page-heading">
|
||||||
|
<h3>Lista de Relatórios</h3>
|
||||||
|
</div>
|
||||||
|
<div className="page-content">
|
||||||
|
<section className="row">
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="card">
|
||||||
|
<div className="card-header d-flex justify-content-between align-items-center">
|
||||||
|
<h4 className="card-title mb-0">Relatórios Cadastrados</h4>
|
||||||
|
<Link to={'criar'}>
|
||||||
|
<button
|
||||||
|
className="btn btn-primary"
|
||||||
|
>
|
||||||
|
<i className="bi bi-plus-circle"></i> Adicionar Relatório
|
||||||
|
</button>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="card-body">
|
||||||
|
<div className="card p-3 mb-3">
|
||||||
|
<h5 className="mb-3">
|
||||||
|
<i className="bi bi-funnel-fill me-2 text-primary"></i>{" "}
|
||||||
|
Filtros
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className="d-flex flex-nowrap align-items-center gap-2"
|
||||||
|
style={{ overflowX: "auto", paddingBottom: "6px" }}
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="form-control"
|
||||||
|
placeholder="Buscar por nome..."
|
||||||
|
|
||||||
|
|
||||||
|
style={{
|
||||||
|
minWidth: 250,
|
||||||
|
maxWidth: 300,
|
||||||
|
width: 260,
|
||||||
|
flex: "0 0 auto",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="table-responsive">
|
||||||
|
<table className="table table-striped table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Paciente</th>
|
||||||
|
<th>CPF</th>
|
||||||
|
|
||||||
|
<th>Exame</th>
|
||||||
|
<th></th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{RelatoriosFiltrados.length > 0 ? (
|
||||||
|
RelatoriosFiltrados.map((relatorio, index) => (
|
||||||
|
<tr key={relatorio.id}>
|
||||||
|
<td>{relatorio.order_number}</td>
|
||||||
|
<td className='infos-paciente'>{PacientesComRelatorios[index]?.full_name}</td>
|
||||||
|
<td className='infos-paciente'>{PacientesComRelatorios[index]?.cpf}</td>
|
||||||
|
<td>{relatorio.exam}</td>
|
||||||
|
<td>{relatorio.create_at}</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="btn-group mb-1">
|
||||||
|
<div class="dropdown">
|
||||||
|
|
||||||
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||||
|
<button class="btn btn-primary dropdown-toggle me-1" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
Ações
|
||||||
|
</button>
|
||||||
|
<a class="dropdown-item" href="#">Visualizar</a>
|
||||||
|
<a class="dropdown-item" href="#">Editar</a>
|
||||||
|
<a class="dropdown-item" href="#">Excluir</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<tr>
|
||||||
|
<td colSpan="8" className="text-center">
|
||||||
|
Nenhum paciente encontrado.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DoctorRelatorioManager
|
||||||
208
src/PagesMedico/FormNovoRelatorio.jsx
Normal file
208
src/PagesMedico/FormNovoRelatorio.jsx
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import '../PagesMedico/styleMedico/FormNovoRelatorio.css'
|
||||||
|
import { useState } from 'react'
|
||||||
|
import { useNavigate } from 'react-router-dom'
|
||||||
|
import { useAuth } from '../components/utils/AuthProvider'
|
||||||
|
import { GetPatientByCPF } from '../components/utils/Functions-Endpoints/Patient'
|
||||||
|
import { FormatCPF } from '../components/utils/Formatar/Format'
|
||||||
|
import API_KEY from '../components/utils/apiKeys'
|
||||||
|
import html2pdf from "html2pdf.js";
|
||||||
|
|
||||||
|
|
||||||
|
const FormNovoRelatorio = () => {
|
||||||
|
const {getAuthorizationHeader} = useAuth()
|
||||||
|
let authHeader = getAuthorizationHeader()
|
||||||
|
const navigate= useNavigate()
|
||||||
|
const [DictInfo, setDictInfo] = useState({})
|
||||||
|
const [showModal, setShowModal] = useState(false)
|
||||||
|
|
||||||
|
const handleChange = (e) => {
|
||||||
|
const { name, value } = e.target;
|
||||||
|
console.log(name, value)
|
||||||
|
|
||||||
|
|
||||||
|
if(name === 'paciente_cpf') {
|
||||||
|
const formattedCPF = FormatCPF(value);
|
||||||
|
setDictInfo((prev) => ({ ...prev, [name]: formattedCPF }));
|
||||||
|
|
||||||
|
const fetchPatient = async () => {
|
||||||
|
const patientData = await GetPatientByCPF(formattedCPF, authHeader);
|
||||||
|
if (patientData) {
|
||||||
|
setDictInfo((prev) => ({
|
||||||
|
...prev,
|
||||||
|
paciente_cpf:value,
|
||||||
|
paciente_nome: patientData.full_name,
|
||||||
|
paciente_id: patientData.id
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
if(formattedCPF.length === 14){
|
||||||
|
fetchPatient();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
setDictInfo((prev) => ({ ...prev, [name]: value }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSubmit = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
console.log(DictInfo)
|
||||||
|
setShowModal(true)
|
||||||
|
|
||||||
|
var myHeaders = new Headers();
|
||||||
|
myHeaders.append("apikey", API_KEY);
|
||||||
|
myHeaders.append("Authorization", authHeader);
|
||||||
|
myHeaders.append("Content-Type", "application/json");
|
||||||
|
|
||||||
|
var raw = JSON.stringify({
|
||||||
|
"patient_id": DictInfo.paciente_id,
|
||||||
|
|
||||||
|
"exam": DictInfo.exam,
|
||||||
|
"diagnosis": DictInfo.diagnosis,
|
||||||
|
"conclusion": DictInfo.conclusao,
|
||||||
|
"status": "draft",
|
||||||
|
"requested_by": DictInfo.requested_by,
|
||||||
|
|
||||||
|
"hide_date": false,
|
||||||
|
"hide_signature": false,
|
||||||
|
});
|
||||||
|
|
||||||
|
var requestOptions = {
|
||||||
|
method: 'POST',
|
||||||
|
headers: myHeaders,
|
||||||
|
body: raw,
|
||||||
|
redirect: 'follow'
|
||||||
|
};
|
||||||
|
|
||||||
|
fetch("https://yuanqfswhberkoevtmfr.supabase.co/rest/v1/reports", requestOptions)
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(result => console.log(result))
|
||||||
|
.catch(error => console.log('error', error));
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{showModal &&(
|
||||||
|
<div className="modal" style={{ display: 'block', backgroundColor: 'rgba(0,0,0,0.5)' }}>
|
||||||
|
<div className="modal-dialog">
|
||||||
|
<div className="modal-content">
|
||||||
|
<div className="modal-header bg-success text-white">
|
||||||
|
<h5 className="modal-title ">Relatório criado com sucesso</h5>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn-close"
|
||||||
|
onClick={() => setShowModal(false)}
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
|
<div className="modal-body">
|
||||||
|
<p>Você também pode baixa-lo agora em pdf</p>
|
||||||
|
</div>
|
||||||
|
<div className="modal-footer">
|
||||||
|
<button className="btn btn-primary"><i className='bi bi-file-pdf-fill'></i> baixar em pdf</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-primary"
|
||||||
|
onClick={() => {setShowModal(false); navigate(('/medico/relatorios'))}}
|
||||||
|
>
|
||||||
|
Fechar
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<h3>Criar novo relatório</h3>
|
||||||
|
|
||||||
|
<div className='card'>
|
||||||
|
|
||||||
|
<form action="" onSubmit={handleSubmit}>
|
||||||
|
<div id='primeiraLinha'>
|
||||||
|
|
||||||
|
<div className="col-md-2 mb-3">
|
||||||
|
<label >Nome do paciente:</label>
|
||||||
|
<input type="text" step="0.1" className="form-control" name="paciente_nome" onChange={handleChange} value={DictInfo.paciente_nome || ''} required />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="col-md-2 mb-3">
|
||||||
|
<label >CPF do paciente:</label>
|
||||||
|
<input type="text" step="0.1" className="form-control" name="paciente_cpf" onChange={handleChange} value={DictInfo.paciente_cpf || ''} required />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div className="col-md-2 mb-3">
|
||||||
|
<label >Nome do médico:</label>
|
||||||
|
<input type="text" step="0.1" className="form-control" name="requested_by" onChange={handleChange} value={DictInfo.requested_by || ''} required />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="col-md-2 mb-3">
|
||||||
|
<label >Exame:</label>
|
||||||
|
<input type="text" className="form-control" name="exam" onChange={handleChange} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div className="col-md-2 mb-3">
|
||||||
|
<label >Data do exame:</label>
|
||||||
|
<input type="date" className="form-control" name="data_exame" onChange={handleChange} value={DictInfo.data_exame || ''} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='row'>
|
||||||
|
<div className="col-md-2 mb-3">
|
||||||
|
<label htmlFor='diagnostico'>Diagnostico:</label>
|
||||||
|
<textarea name="diagnostico" id="diagnostico" onChange={handleChange} cols="30" rows="5" value={DictInfo.diagnostico || ''}></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="col-md-2 mb-3">
|
||||||
|
<label htmlFor='conclusao'>Conclusão:</label>
|
||||||
|
<textarea name="conclusao" id="conclusao" onChange={handleChange} cols="30" rows="5" value={DictInfo.conclusao || ''}></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
className="btn btn-success submitButton"
|
||||||
|
type='submit'
|
||||||
|
>
|
||||||
|
Salvar
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Modelo do relatório</h3>
|
||||||
|
<div id="folhaA4">
|
||||||
|
|
||||||
|
<div id='header-relatorio'>
|
||||||
|
<p>Clinica Rise up</p>
|
||||||
|
<p>Dr {DictInfo.requested_by} - CRM/SP 123456</p>
|
||||||
|
<p>Avenida - (79) 9 4444-4444</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id='infoPaciente'>
|
||||||
|
<p>Paciente: {DictInfo?.paciente_nome}</p>
|
||||||
|
<p>Data de nascimento: </p>
|
||||||
|
|
||||||
|
<p>Data do exame: {DictInfo.data_exame}</p>
|
||||||
|
|
||||||
|
<p>Exame: {DictInfo.exame}</p>
|
||||||
|
|
||||||
|
<p>Diagnostico: {DictInfo.diagnostico}</p>
|
||||||
|
|
||||||
|
<p>Conclusão: {DictInfo.conclusao}</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>Dr {DictInfo.requested_by}</p>
|
||||||
|
<p>Emitido em: 0</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default FormNovoRelatorio
|
||||||
55
src/PagesMedico/styleMedico/FormNovoRelatorio.css
Normal file
55
src/PagesMedico/styleMedico/FormNovoRelatorio.css
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#folhaA4 {
|
||||||
|
width: 210mm;
|
||||||
|
min-height: 207mm;
|
||||||
|
padding: 20mm;
|
||||||
|
margin: 10mm auto;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
background: white;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#primeiraLinha{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,textarea,label{
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea{
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.submitButton{
|
||||||
|
display: flex;
|
||||||
|
margin-left: auto;
|
||||||
|
height:50% ;
|
||||||
|
padding: 8px 20px;
|
||||||
|
|
||||||
|
font-size: medium;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bi-download{
|
||||||
|
font-size: 1.2rem;
|
||||||
|
margin-right: 5px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#infoPaciente{
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header-relatorio{
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-paciente{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@ import API_KEY from "../apiKeys";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const GetByID = async (ID,authHeader) => {
|
const GetPatientByID = async (ID,authHeader) => {
|
||||||
|
|
||||||
console.log(authHeader, 'mostrando autorização dentro da função')
|
console.log(authHeader, 'mostrando autorização dentro da função')
|
||||||
|
|
||||||
@ -22,4 +22,34 @@ const DictPaciente = await result.json()
|
|||||||
return DictPaciente
|
return DictPaciente
|
||||||
}
|
}
|
||||||
|
|
||||||
export {GetByID}
|
const GetAllPatients = async (authHeader) => {
|
||||||
|
var myHeaders = new Headers();
|
||||||
|
myHeaders.append("apikey", API_KEY);
|
||||||
|
myHeaders.append("Authorization", authHeader);
|
||||||
|
|
||||||
|
var requestOptions = {
|
||||||
|
method: 'GET',
|
||||||
|
headers: myHeaders,
|
||||||
|
redirect: 'follow'
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = await fetch("https://yuanqfswhberkoevtmfr.supabase.co/rest/v1/patients", requestOptions)
|
||||||
|
const DictPacientes = await result.json()
|
||||||
|
return DictPacientes
|
||||||
|
}
|
||||||
|
|
||||||
|
const GetPatientByCPF = async (cpf, authHeader) => {
|
||||||
|
const Pacientes = await GetAllPatients(authHeader)
|
||||||
|
|
||||||
|
|
||||||
|
for (let i = 0; i < Pacientes.length; i++) {
|
||||||
|
if (Pacientes[i].cpf === cpf) {
|
||||||
|
console.log('Paciente encontrado:', Pacientes[i]);
|
||||||
|
return Pacientes[i];
|
||||||
|
}
|
||||||
|
else{console.log("nada encontrado")}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export {GetPatientByID, GetAllPatients, GetPatientByCPF}
|
||||||
@ -9,12 +9,6 @@
|
|||||||
"icon": "calendar-plus-fill",
|
"icon": "calendar-plus-fill",
|
||||||
"url": "/medico/prontuario"
|
"url": "/medico/prontuario"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
"name": "Laudos",
|
|
||||||
"icon": "table",
|
|
||||||
"url": "/medico/laudo"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Seus Agendamentos",
|
"name": "Seus Agendamentos",
|
||||||
"icon": "calendar",
|
"icon": "calendar",
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
|
|||||||
import avatarPlaceholder from '../assets/images/avatar_placeholder.png';
|
import avatarPlaceholder from '../assets/images/avatar_placeholder.png';
|
||||||
import { useParams, useNavigate, useLocation, Navigate } from "react-router-dom";
|
import { useParams, useNavigate, useLocation, Navigate } from "react-router-dom";
|
||||||
import API_KEY from "../components/utils/apiKeys";
|
import API_KEY from "../components/utils/apiKeys";
|
||||||
import {GetByID} from "../components/utils/Functions-Endpoints/Patient"
|
import {GetPatientByID} from "../components/utils/Functions-Endpoints/Patient"
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useAuth } from "../components/utils/AuthProvider";
|
import { useAuth } from "../components/utils/AuthProvider";
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ const Details = () => {
|
|||||||
console.log(patientID, 'teu id')
|
console.log(patientID, 'teu id')
|
||||||
const authHeader = getAuthorizationHeader()
|
const authHeader = getAuthorizationHeader()
|
||||||
|
|
||||||
GetByID(patientID, authHeader)
|
GetPatientByID(patientID, authHeader)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
console.log(data, "paciente vindo da API");
|
console.log(data, "paciente vindo da API");
|
||||||
setPaciente(data[0]); // supabase retorna array
|
setPaciente(data[0]); // supabase retorna array
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import React from 'react'
|
|||||||
import PatientForm from '../components/patients/PatientForm'
|
import PatientForm from '../components/patients/PatientForm'
|
||||||
|
|
||||||
import {useEffect, useState} from 'react'
|
import {useEffect, useState} from 'react'
|
||||||
import { GetByID } from '../components/utils/Functions-Endpoints/Patient'
|
import { GetPatientByID } from '../components/utils/Functions-Endpoints/Patient'
|
||||||
import API_KEY from '../components/utils/apiKeys'
|
import API_KEY from '../components/utils/apiKeys'
|
||||||
import {useNavigate, useParams } from 'react-router-dom'
|
import {useNavigate, useParams } from 'react-router-dom'
|
||||||
import { useAuth } from '../components/utils/AuthProvider'
|
import { useAuth } from '../components/utils/AuthProvider'
|
||||||
@ -19,7 +19,7 @@ const PatientID = Parametros.id
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const authHeader = getAuthorizationHeader()
|
const authHeader = getAuthorizationHeader()
|
||||||
|
|
||||||
GetByID(PatientID, authHeader)
|
GetPatientByID(PatientID, authHeader)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
console.log(data[0], "paciente vindo da API");
|
console.log(data[0], "paciente vindo da API");
|
||||||
setPatientPUT(data[0]); // supabase retorna array
|
setPatientPUT(data[0]); // supabase retorna array
|
||||||
|
|||||||
@ -11,33 +11,6 @@ function Inicio() {
|
|||||||
const [pacientes, setPacientes] = useState([]);
|
const [pacientes, setPacientes] = useState([]);
|
||||||
const [agendamentos, setAgendamentos] = useState([]);
|
const [agendamentos, setAgendamentos] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
/*const fetchPacientes = async () => {
|
|
||||||
try {
|
|
||||||
const res = await fetch("https://mock.apidog.com/m1/1053378-0-default/pacientes");
|
|
||||||
const data = await res.json();
|
|
||||||
console.log(data)
|
|
||||||
//setPacientes(data.data);
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Erro ao buscar pacientes:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchAgendamentos = async () => {
|
|
||||||
return; // <===serve para que nao cause erro
|
|
||||||
// try {
|
|
||||||
// const res = await fetch();
|
|
||||||
// const data = await res.json();
|
|
||||||
// setAgendamentos(data.data);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error("Erro ao buscar agendamentos:", error);
|
|
||||||
// }
|
|
||||||
};
|
|
||||||
|
|
||||||
fetchPacientes();
|
|
||||||
fetchAgendamentos();*/
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const totalPacientes = pacientes.length;
|
const totalPacientes = pacientes.length;
|
||||||
const novosEsseMes = pacientes.filter(p => p.createdAt && new Date(p.createdAt).getMonth() === new Date().getMonth()).length;
|
const novosEsseMes = pacientes.filter(p => p.createdAt && new Date(p.createdAt).getMonth() === new Date().getMonth()).length;
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import { Routes, Route } from "react-router-dom";
|
import { Routes, Route } from "react-router-dom";
|
||||||
import Sidebar from "../../components/Sidebar";
|
import Sidebar from "../../components/Sidebar";
|
||||||
|
|
||||||
import LaudoManager from "../../pages/LaudoManager";
|
import DoctorRelatorioManager from "../../PagesMedico/DoctorRelatorioManager";
|
||||||
import Prontuario from "../../PagesMedico/prontuario";
|
import Prontuario from "../../PagesMedico/prontuario";
|
||||||
import Relatorio from "../../PagesMedico/relatorio";
|
import Relatorio from "../../PagesMedico/relatorio";
|
||||||
import Agendamento from "../../PagesMedico/Agendamento";
|
import Agendamento from "../../PagesMedico/Agendamento";
|
||||||
import Chat from "../../PagesMedico/Chat";
|
import Chat from "../../PagesMedico/Chat";
|
||||||
import DoctorItems from "../../data/sidebar-items-medico.json";
|
import DoctorItems from "../../data/sidebar-items-medico.json";
|
||||||
|
import FormNovoRelatorio from "../../PagesMedico/FormNovoRelatorio";
|
||||||
// ...existing code...
|
// ...existing code...
|
||||||
|
|
||||||
function PerfilMedico() {
|
function PerfilMedico() {
|
||||||
@ -16,12 +17,12 @@ function PerfilMedico() {
|
|||||||
<Sidebar menuItems={DoctorItems} />
|
<Sidebar menuItems={DoctorItems} />
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<LaudoManager />} />
|
<Route path="/" element={<DoctorRelatorioManager />} />
|
||||||
<Route path="/laudo" element={<LaudoManager />} />
|
<Route path="/relatorios/criar" element={<FormNovoRelatorio />} />
|
||||||
<Route path="/prontuario" element={<Prontuario />} />
|
<Route path="/prontuario" element={<Prontuario />} />
|
||||||
<Route path="/relatorios" element={<Relatorio />} />
|
<Route path="/relatorios" element={<DoctorRelatorioManager />} />
|
||||||
<Route path="/agendamentoMedico" element={<Agendamento />} />
|
<Route path="/agendamentoMedico" element={<Agendamento />} />
|
||||||
<Route path="/chat" element={<Chat />} /> {/* <-- nova rota */}
|
<Route path="/chat" element={<Chat />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -12,9 +12,7 @@ function PerfilFinanceiro({ onLogout }) {
|
|||||||
<div id="main">
|
<div id="main">
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<FinanceiroDashboard/>}/>
|
<Route path="/" element={<FinanceiroDashboard/>}/>
|
||||||
|
|
||||||
<Route path="controlefinanceiro" element={<FinanceiroDashboard/>}/>
|
<Route path="controlefinanceiro" element={<FinanceiroDashboard/>}/>
|
||||||
|
|
||||||
<Route path="*" element={<h2>Página não encontrada</h2>} />
|
<Route path="*" element={<h2>Página não encontrada</h2>} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user