Flatten nested repos
This commit is contained in:
0
test/vuex/hasil01/action.js
Normal file
0
test/vuex/hasil01/action.js
Normal file
31
test/vuex/hasil01/api.js
Normal file
31
test/vuex/hasil01/api.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"http://lebaran.aplikasi.web.id/smartlab_api/vuex/t02/search_bank";
|
||||
|
||||
export async function searchBank(query, page, rowPerPage = 15) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
query: query,
|
||||
page: page,
|
||||
rowPerPage: rowPerPage
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
data.query = query;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
71
test/vuex/hasil01/components/hasilBoxV1.vue
Normal file
71
test/vuex/hasil01/components/hasilBoxV1.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<v-card class="fill-height" >
|
||||
<v-card-text >
|
||||
<v-autocomplete
|
||||
cache-items
|
||||
hide-no-data
|
||||
hide-details
|
||||
label="Nama Dokter"
|
||||
solo-inverted
|
||||
></v-autocomplete>
|
||||
|
||||
<v-select label="Alamat Dokter" ></v-select>
|
||||
<v-select label="Bahasa" ></v-select>
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Tanggal</th>
|
||||
<th>Jam</th>
|
||||
<th>Pemeriksaan</th>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style = "text-align: left; padding : 5px;">12/12/2019</td>
|
||||
<td >13.30</td>
|
||||
<td >SGOT,SGPT</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style = "text-align: left; padding : 5px;">15/12/2019</td>
|
||||
<td >16.00</td>
|
||||
<td > Urine Lengkap</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<v-spacer></v-spacer>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
<style scoped>
|
||||
.myclass {
|
||||
height:100%;
|
||||
}
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table, th {
|
||||
border: 1px solid #dddddd;
|
||||
text-align: center;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
|
||||
tr:nth-child(even) {
|
||||
background-color: #dddddd;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
71
test/vuex/hasil01/components/kirimBoxV1.vue
Normal file
71
test/vuex/hasil01/components/kirimBoxV1.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
|
||||
<v-card class="my-right fill-height">
|
||||
<v-card-text>
|
||||
<v-layout>
|
||||
<v-flex xs12 md3>
|
||||
<v-checkbox v-model="checkbox" :error-messages="checkboxErrors" label="Email Pasien" @change="$v.checkbox.$touch()" @blur="$v.checkbox.$touch()" ></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs12 md9 >
|
||||
<v-text-field v-model="email" :error-messages="emailErrors" label="E-mail" @input="$v.email.$touch()" @blur="$v.email.$touch()" ></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs12 md3>
|
||||
<v-checkbox v-model="checkbox" :error-messages="checkboxErrors" label="Email Dokter " @change="$v.checkbox.$touch()" @blur="$v.checkbox.$touch()" ></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs12 md9 >
|
||||
<v-text-field v-model="email" :error-messages="emailErrors" label="E-mail" @input="$v.email.$touch()" @blur="$v.email.$touch()" ></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs12 md3>
|
||||
<v-checkbox v-model="checkbox" :error-messages="checkboxErrors" label="Email Rekanan " @change="$v.checkbox.$touch()" @blur="$v.checkbox.$touch()" ></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs12 md9 >
|
||||
<v-text-field v-model="email" :error-messages="emailErrors" label="E-mail" @input="$v.email.$touch()" @blur="$v.email.$touch()" ></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs12 md3>
|
||||
<v-checkbox v-model="checkbox" :error-messages="checkboxErrors" label="Kirim Rekanan" @change="$v.checkbox.$touch()" @blur="$v.checkbox.$touch()" ></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs12 md9 >
|
||||
<v-text-field v-model="email" :error-messages="emailErrors" label="Alamat Rekanan" @input="$v.email.$touch()" @blur="$v.email.$touch()" ></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs12 md3>
|
||||
<v-checkbox v-model="checkbox" :error-messages="checkboxErrors" label="Kirim Dokter" @change="$v.checkbox.$touch()" @blur="$v.checkbox.$touch()" ></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs12 md9 >
|
||||
<v-text-field v-model="email" :error-messages="emailErrors" label="Alamat Dokter" @input="$v.email.$touch()" @blur="$v.email.$touch()" ></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs12 md3>
|
||||
<v-checkbox v-model="checkbox" :error-messages="checkboxErrors" label="Ambil Sendiri " @change="$v.checkbox.$touch()" @blur="$v.checkbox.$touch()" ></v-checkbox>
|
||||
</v-flex>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
|
||||
</template>
|
||||
<style scoped>
|
||||
.my-right {
|
||||
margin-left:10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
33
test/vuex/hasil01/components/oneFoHasilV1.vue
Normal file
33
test/vuex/hasil01/components/oneFoHasilV1.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 fill-height class="left">
|
||||
<hasil-box> </hasil-box>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 class="right" fill-height>
|
||||
<kirim-box> </kirim-box>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.judul {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'hasil-box' : httpVueLoader('./hasilBoxV1.vue'),
|
||||
'kirim-box' : httpVueLoader('./kirimBoxV1.vue'),
|
||||
}
|
||||
}
|
||||
</script>
|
||||
59
test/vuex/hasil01/index.php
Normal file
59
test/vuex/hasil01/index.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<!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" >
|
||||
<v-container fluid fill-height>
|
||||
|
||||
<one-fo-hasil> </one-fo-hasil>
|
||||
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<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>
|
||||
<!-- 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,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-fo-hasil': httpVueLoader('./components/oneFoHasilV1.vue'),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
0
test/vuex/hasil01/mutation.js
Normal file
0
test/vuex/hasil01/mutation.js
Normal file
71
test/vuex/hasil01/store.js
Normal file
71
test/vuex/hasil01/store.js
Normal file
@@ -0,0 +1,71 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import * as api from "./api.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
state: {
|
||||
rows: [],
|
||||
midPages: [],
|
||||
isLoading: false,
|
||||
isError: false,
|
||||
errorMessage: "",
|
||||
query: "",
|
||||
page: 0,
|
||||
totalPage: 0,
|
||||
totalRecord: 0
|
||||
},
|
||||
mutations: {
|
||||
updateBank(state, data) {
|
||||
// console.log(data);
|
||||
if (data.status == "ERR") {
|
||||
state.isError = true;
|
||||
if (data.db_error) {
|
||||
state.errorMessage = data.db_error.message;
|
||||
} else {
|
||||
state.errorMessage = data.message;
|
||||
}
|
||||
state.query = data.query;
|
||||
state.page = 0;
|
||||
state.totalPage = 0;
|
||||
state.totalRecord = 0;
|
||||
state.rows = [];
|
||||
state.midPages = [];
|
||||
} else {
|
||||
state.isError = false;
|
||||
state.errorMessage = "";
|
||||
state.query = data.query;
|
||||
state.page = data.page;
|
||||
state.totalPage = data.totalPage;
|
||||
state.totalRecord = data.totalRecord;
|
||||
state.rows = data.rows;
|
||||
state.midPages = data.midPages;
|
||||
}
|
||||
},
|
||||
updateLoading(state, flag) {
|
||||
state.isLoading = flag;
|
||||
},
|
||||
resetError(state) {
|
||||
state.isError = false;
|
||||
state.errorMessage = "";
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async searchBank(context, data) {
|
||||
context.commit("updateLoading", true);
|
||||
let resp = await api.searchBank(
|
||||
data.query,
|
||||
data.page,
|
||||
data.rowPerPage
|
||||
);
|
||||
context.commit("updateLoading", false);
|
||||
context.commit("updateBank", resp);
|
||||
setTimeout(function() {
|
||||
context.commit("resetError");
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user