Flatten nested repos
This commit is contained in:
120
test/vuex/one-report-view/components/oneReportView.vue
Normal file
120
test/vuex/one-report-view/components/oneReportView.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<v-flex xs12 v-for="(group, idx) in reports" v-bind:key="group">
|
||||
<v-card>
|
||||
|
||||
<v-card-title primary-title>
|
||||
<div>
|
||||
<h3 class="headline mb-0">{{ group.group }}</h3>
|
||||
<!-- <div> {{ card_text }} </div> -->
|
||||
</div>
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-list two-line>
|
||||
<template v-for="(report, index) in group.child">
|
||||
<v-layout row :key="report.code" wrap>
|
||||
<v-flex xs2>
|
||||
<v-list-tile
|
||||
avatar
|
||||
ripple
|
||||
@click="toggle(index)"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ report.code }}</v-list-tile-title>
|
||||
<v-list-tile-sub-title class="text--primary">{{ report.label }}</v-list-tile-sub-title>
|
||||
<!-- <v-list-tile-sub-title>{{ item.subtitle }}</v-list-tile-sub-title> -->
|
||||
</v-list-tile-content>
|
||||
|
||||
<v-list-tile-action>
|
||||
|
||||
|
||||
</v-list-tile-action>
|
||||
|
||||
</v-list-tile>
|
||||
<v-divider
|
||||
v-if="index + 1 < group.child.length"
|
||||
:key="index"
|
||||
></v-divider>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
</v-list>
|
||||
</v-card-text>
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
|
||||
},
|
||||
computed: {
|
||||
reports () {
|
||||
return this.$store.state.reports.reports
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggle (index) {
|
||||
const i = this.selected.indexOf(index)
|
||||
|
||||
if (i > -1) {
|
||||
this.selected.splice(i, 1)
|
||||
} else {
|
||||
this.selected.push(index)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
|
||||
},
|
||||
mounted: function() {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
card_text: 'Lorem ipsum dolor sit amet, brute iriure accusata ne mea. Eos suavitate referrentur ad, te duo agam libris qualisque, utroque quaestio accommodare no qui. Et percipit laboramus usu, no invidunt verterem nominati mel. Dolorem ancillae an mei, ut putant invenire splendide mel, ea nec propriae adipisci. Ignota salutandi accusamus in sed, et per malis fuisset, qui id ludus appareat.',
|
||||
selected: [2],
|
||||
items: [
|
||||
{
|
||||
action: '15 min',
|
||||
headline: 'Brunch this weekend?',
|
||||
title: 'Ali Connors',
|
||||
subtitle: "I'll be in your neighborhood doing errands this weekend. Do you want to hang out?"
|
||||
},
|
||||
{
|
||||
action: '2 hr',
|
||||
headline: 'Summer BBQ',
|
||||
title: 'me, Scrott, Jennifer',
|
||||
subtitle: "Wish I could come, but I'm out of town this weekend."
|
||||
},
|
||||
{
|
||||
action: '6 hr',
|
||||
headline: 'Oui oui',
|
||||
title: 'Sandra Adams',
|
||||
subtitle: 'Do you have Paris recommendations? Have you ever been?'
|
||||
},
|
||||
{
|
||||
action: '12 hr',
|
||||
headline: 'Birthday gift',
|
||||
title: 'Trevor Hansen',
|
||||
subtitle: 'Have any ideas about what we should get Heidi for her birthday?'
|
||||
},
|
||||
{
|
||||
action: '18hr',
|
||||
headline: 'Recipe to try',
|
||||
title: 'Britta Holt',
|
||||
subtitle: 'We should eat this: Grate, Squash, Corn, and tomatillo Tacos.'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
86
test/vuex/one-report-view/index.php
Normal file
86
test/vuex/one-report-view/index.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
|
||||
<one-navbar></one-navbar>
|
||||
<v-content class="blue lighten-5 one" >
|
||||
<v-container fluid pt-2 pb-2 pl-1 pr-1>
|
||||
<v-layout column>
|
||||
<v-flex xs12 shrink>
|
||||
|
||||
<one-report-view></one-report-view>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../../libs/vendor/vue.js"></script>
|
||||
<script src="../../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../../libs/vendor/httpVueLoader.js"></script>
|
||||
|
||||
<script src="../../../libs/one_global.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
data : {
|
||||
|
||||
},
|
||||
mounted: function() {
|
||||
|
||||
},
|
||||
computed : {
|
||||
|
||||
},
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-report-view': httpVueLoader('./components/oneReportView.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.v-content.one {
|
||||
//padding:64px 0px 0px !important;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
25
test/vuex/one-report-view/modules/reports.js
Normal file
25
test/vuex/one-report-view/modules/reports.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
// import * as api from "../api/login.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
reports : [
|
||||
{
|
||||
"group":"Front Office",
|
||||
"child":[
|
||||
{"code":"FO-A1", "label":"Kartu Kontrol"},
|
||||
{"code":"FO-A2", "label":"Invoice"}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
}
|
||||
22
test/vuex/one-report-view/store.js
Normal file
22
test/vuex/one-report-view/store.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import reports from "./modules/reports.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
reports : reports
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user