Skip to content
Snippets Groups Projects
Commit c9ff4082 authored by Rizky Andyno Ramadhan's avatar Rizky Andyno Ramadhan
Browse files

added real data to the top page and fixed numerical text

parent 7c4225ac
Branches
2 merge requests!18Asik asik,!17Merge feature-visualisasi into develop
Pipeline #12772 canceled with stage
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<b-row class="justify-content-md-center"> <b-row class="justify-content-md-center">
<b-col id="visualization" class="bg-light" cols="12" lg="8"> <b-col id="visualization" class="bg-light" cols="12" lg="8">
<visualization <visualization
src="http://puu.sh/D6W1v.csv" v-bind:src="data"
@click-handler="handler" @click-handler="handler"
/> />
</b-col> </b-col>
<b-col cols="12" lg="4"> <b-col cols="12" lg="4">
<simple-card-container :dataBubble="data_bubble" /> <simple-card-container :dataBubble="data" />
</b-col> </b-col>
</b-row> </b-row>
<div id="comments-container"> <div id="comments-container">
...@@ -32,41 +32,33 @@ export default { ...@@ -32,41 +32,33 @@ export default {
}, },
data() { data() {
return { return {
data_bubble : [ data : []
{
judul : "anggaran X",
biaya : "1000.0000"
},
{
judul : "anggaran X",
biaya : "1000.0000"
},
{
judul : "anggaran X",
biaya : "1000.0000"
},
{
judul : "anggaran X",
biaya : "1000.0000"
},
]
} }
}, },
methods: { methods: {
handler(id) { handler(idobj) {
if (id === '0') { let id = idobj.$oid
this.$router.push('/pendapatan') this.$router.push({ name: 'BiayaLangsungId', params: { id: id } })
} else if (id === '1') { },
this.$router.push('/biaya-langsung') getDataFromTop() {
} else if (id === '2') { let fetchData = {
this.$router.push('/biaya-tidak-langsung') method: 'POST',
} else if (id === '3') { body: JSON.stringify({ year: 2019 }),
this.$router.push('/pembiayaan') headers: { "Content-Type": "application/json" }
} }
}
fetch(`${this.$store.state.baseUrl}/api/page/get-top`, fetchData)
.then(response => response.json())
.then(response => {
if(response.status === 200) {
this.data = response.subdata
}
})
},
}, },
created : function() { created : function() {
this.$store.commit('changed','Semua Anggaran') this.$store.commit('changed','Semua Anggaran')
this.getDataFromTop()
} }
} }
</script> </script>
......
<template> <template>
<b-row id="content-detail"> <b-row id="content-detail">
<simple-card v-for="data in dataBubble" :key="data.judul" v-bind:jenisAnggaran="data.judul" v-bind:totalAnggaran="data.biaya" /> <simple-card v-for="data in dataBubble" :key="data.name" v-bind:jenisAnggaran="data.name" v-bind:totalAnggaran="data.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.') +
',00.-'"/>
</b-row> </b-row>
</template> </template>
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
{{"Detail KEGIATAN"+ "(" + rows + ")" }} {{"Detail KEGIATAN"+ "(" + rows + ")" }}
</h4> </h4>
<b-row id="content-detail"> <b-row id="content-detail">
<simple-card v-for="data in dataBubble" :key="data._id.$oid" v-bind:jenisAnggaran="data.name" v-bind:totalAnggaran="data.value" /> <simple-card v-for="data in dataBubble" :key="data._id.$oid" v-bind:jenisAnggaran="data.name" v-bind:totalAnggaran="data.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.') +
',00.-'"" />
</b-row> </b-row>
</div> </div>
</template> </template>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment