change query data graph tab

This commit is contained in:
2024-08-07 14:56:07 +07:00
parent a729d6ab67
commit 55a2e1bbfd
26 changed files with 1125 additions and 354 deletions

View File

@@ -3,7 +3,8 @@ package corporate_mcudetail
templ Tabkelainanfisik(
chartsxs []templ.Component,
chartsmd []templ.Component,
chartslg []templ.Component,
chartslg []templ.Component,
barchart []templ.Component,
) {
<div class="container-fluid">
<div class="d-flex justify-content-center py-10">
@@ -13,6 +14,9 @@ templ Tabkelainanfisik(
// xs
<div class="d-xs-block d-sm-block d-md-none">
<div class="row justify-content-center">
<div class="col-12 my-4">
@ChartCard(barchart[2])
</div>
for _, c := range chartsxs {
<div class="col-12 my-4">
@ChartCard(c)
@@ -24,17 +28,23 @@ templ Tabkelainanfisik(
// md
<div class="d-none d-md-block d-lg-none">
<div class="row justify-content-center">
<div class="col-12 my-4">
@ChartCard(barchart[1])
</div>
for _, c := range chartsmd {
<div class="col-12 my-4">
@ChartCard(c)
</div>
}
}
</div>
</div>
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
<div class="col-12 my-4">
@ChartCard(barchart[0])
</div>
for _, c := range chartslg {
<div class="col-6 my-4">
@ChartCard(c)

View File

@@ -14,6 +14,7 @@ func Tabkelainanfisik(
chartsxs []templ.Component,
chartsmd []templ.Component,
chartslg []templ.Component,
barchart []templ.Component,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
@@ -27,7 +28,15 @@ func Tabkelainanfisik(
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-fluid\"><div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Data Presentase Kelainan Fisik</h2></div><div class=\"d-xs-block d-sm-block d-md-none\"><div class=\"row justify-content-center\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-fluid\"><div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Data Presentase Kelainan Fisik</h2></div><div class=\"d-xs-block d-sm-block d-md-none\"><div class=\"row justify-content-center\"><div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(barchart[2]).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -45,7 +54,15 @@ func Tabkelainanfisik(
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-md-block d-lg-none\"><div class=\"row justify-content-center\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-md-block d-lg-none\"><div class=\"row justify-content-center\"><div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(barchart[1]).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -63,7 +80,15 @@ func Tabkelainanfisik(
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\"><div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(barchart[0]).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -1,7 +1,6 @@
package corporate_mcudetail
templ TabKelainanLab(
chartpresentaselg templ.Component,
chartsxs []templ.Component,
chartsmd []templ.Component,
chartslg []templ.Component,
@@ -36,13 +35,16 @@ templ TabKelainanLab(
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
<div class="col-12 my-4">
@ChartCard(chartpresentaselg)
</div>
for _, c := range chartslg{
<div class="col-6 my-4">
@ChartCard(c)
</div>
for i, c := range chartslg {
if i == 0 {
<div class="col-12 my-4">
@ChartCard(c)
</div>
} else {
<div class="col-6 my-4">
@ChartCard(c)
</div>
}
}
</div>
</div>

View File

@@ -11,7 +11,6 @@ import "io"
import "bytes"
func TabKelainanLab(
chartpresentaselg templ.Component,
chartsxs []templ.Component,
chartsmd []templ.Component,
chartslg []templ.Component,
@@ -64,30 +63,37 @@ func TabKelainanLab(
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\"><div class=\"col-12 my-4\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(chartpresentaselg).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, c := range chartslg {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-6 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(c).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
for i, c := range chartslg {
if i == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(c).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-6 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(c).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")

View File

@@ -1,8 +1,6 @@
package corporate_mcudetail
templ TabKelainanNonLab(
// chartpresentase templ.Component,
// chartthorax templ.Component,
chartsxs []templ.Component,
chartsmd []templ.Component,
chartslg []templ.Component,
@@ -37,24 +35,16 @@ templ TabKelainanNonLab(
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
// <div class="col-12 my-4">
// <div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%;">
// <div class="d-flex flex-column pt-8">
// @chartpresentase
// </div>
// </div>
// </div>
// <div class="col-12 my-4">
// <div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%;">
// <div class="d-flex flex-column pt-8">
// @chartthorax
// </div>
// </div>
// </div>
for _, c := range chartslg {
<div class="col-12 my-4">
@ChartCard(c)
</div>
for i, c := range chartslg {
if i == 0 {
<div class="col-12 my-4">
@ChartCard(c)
</div>
} else {
<div class="col-6 my-4">
@ChartCard(c)
</div>
}
}
</div>
</div>

View File

@@ -11,8 +11,6 @@ import "io"
import "bytes"
func TabKelainanNonLab(
// chartpresentase templ.Component,
// chartthorax templ.Component,
chartsxs []templ.Component,
chartsmd []templ.Component,
chartslg []templ.Component,
@@ -69,18 +67,33 @@ func TabKelainanNonLab(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, c := range chartslg {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(c).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
for i, c := range chartslg {
if i == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(c).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-6 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ChartCard(c).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")

View File

@@ -3,6 +3,7 @@ package corporate_mcudetail
import (
"cpone/component/table"
"cpone/models"
"strconv"
)
templ CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID string) {
@@ -36,9 +37,9 @@ templ RowKesimpulan(data []models.ModelKesimpulanLab) {
<td colspan="3" class="text-center">Data Tidak Ditemukan</td>
</tr>
}
for _, v := range data {
for idx, v := range data {
<tr>
<td>{ v.Nomor }</td>
<td>{ strconv.Itoa(idx + 1) }</td>
<td>{ v.Test }</td>
<td>{ v.Total }</td>
</tr>

View File

@@ -13,6 +13,7 @@ import "bytes"
import (
"cpone/component/table"
"cpone/models"
"strconv"
)
func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID string) templ.Component {
@@ -35,7 +36,7 @@ func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 12, Col: 11}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 13, Col: 11}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
@@ -81,7 +82,7 @@ func TableKesimpulan(data []models.ModelKesimpulanLab,
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 25, Col: 18}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 26, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -128,15 +129,15 @@ func RowKesimpulan(data []models.ModelKesimpulanLab) templ.Component {
return templ_7745c5c3_Err
}
}
for _, v := range data {
for idx, v := range data {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Nomor)
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(idx + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 41, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 42, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -149,7 +150,7 @@ func RowKesimpulan(data []models.ModelKesimpulanLab) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Test)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 42, Col: 15}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 43, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -162,7 +163,7 @@ func RowKesimpulan(data []models.ModelKesimpulanLab) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.Total)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 43, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 44, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {

View File

@@ -134,9 +134,9 @@ func TabViewMcuDetail(
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("https://cpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_summary_executive.rptdesign&__format=pdf&PID=" + id + "&username=adhi&tm=1717726294764")
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("/birt/run?__report=report/one/mcu/rpt_summary_executive.rptdesign&__format=pdf&PID=" + id + "&username=adhi&tm=1717726294764")
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutabview.templ`, Line: 65, Col: 168}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutabview.templ`, Line: 66, Col: 139}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {