Initial import
39
apps/api/system/menu-bkp.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const URL = window.BASE_URL + "/one-api/mockup/system/";
|
||||
|
||||
export async function get_bread_crumb(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/get_bread_crumb', {token:token,
|
||||
xref:window.location.href});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function get_menu(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/get_menu', {token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
65
apps/api/system/menu.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const URL = window.BASE_URL + "/one-api/mockup/system/";
|
||||
|
||||
export async function change_password(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/change_password', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function get_bread_crumb(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/get_bread_crumb', {token:token,
|
||||
xref:window.location.href});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function get_menu(token) {
|
||||
try {
|
||||
let currentLocation = window.location.pathname;
|
||||
var resp = await axios.post(URL + 'menu/get_menu', {token:token, path:currentLocation});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
if(data.status == "ERRMENU"){
|
||||
window.location.replace("/"+data.menu)
|
||||
console.log("dasdasd")
|
||||
}
|
||||
else
|
||||
return data;
|
||||
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
106
apps/components/oneAutoVerifValid.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<div class="auto-verif-valid">
|
||||
<img :src="verifImg" class="icon" :style="styleVerif" @click="showVerif()" />
|
||||
<img :src="validImg" class="icon" :style="styleValid" @click="showValid()" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
dialog_autovrvf:false,
|
||||
title:'',
|
||||
isLoading: false
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
showValid() {
|
||||
this.$store.dispatch("autoVerifValid/showValid",{title: "Informasi AutoValid", detailID: this.detailId});
|
||||
},
|
||||
showVerif() {
|
||||
this.$store.dispatch("autoVerifValid/showVerif",{title: "Informasi AutoVerif", detailID: this.detailId});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
styleVerif() {
|
||||
let av = this.$store.state.autoVerifValid.autoVerif;
|
||||
let detId = this.detailId;
|
||||
let idx = _.findIndex(av,function(v) {
|
||||
let xid = parseInt(v.id);
|
||||
return xid == detId;
|
||||
});
|
||||
if (idx > -1) {
|
||||
return {
|
||||
cursor: 'pointer'
|
||||
};
|
||||
}
|
||||
return {};
|
||||
},
|
||||
styleValid() {
|
||||
let av = this.$store.state.autoVerifValid.autoValid;
|
||||
let detId = this.detailId;
|
||||
let idx = _.findIndex(av,function(v) {
|
||||
let xid = parseInt(v.id);
|
||||
return xid == detId;
|
||||
});
|
||||
if (idx > -1) {
|
||||
return {
|
||||
cursor: 'pointer'
|
||||
};
|
||||
}
|
||||
return {};
|
||||
},
|
||||
verifImg() {
|
||||
let av = this.$store.state.autoVerifValid.autoVerif;
|
||||
let detId = this.detailId;
|
||||
let idx = _.findIndex(av,function(v) {
|
||||
let xid = parseInt(v.id);
|
||||
return xid == detId;
|
||||
});
|
||||
if (idx > -1) {
|
||||
if (av[idx].status) {
|
||||
return "/one-ui/apps/image/vr-green.png";
|
||||
} else {
|
||||
return "/one-ui/apps/image/vr-red.png";
|
||||
}
|
||||
} else {
|
||||
return "/one-ui/apps/image/vr-grey.png";
|
||||
}
|
||||
},
|
||||
validImg() {
|
||||
let av = this.$store.state.autoVerifValid.autoValid;
|
||||
let detId = this.detailId;
|
||||
let idx = _.findIndex(av,function(v) {
|
||||
let xid = parseInt(v.id);
|
||||
return xid == detId;
|
||||
});
|
||||
if (idx > -1) {
|
||||
if (av[idx].status) {
|
||||
return "/one-ui/apps/image/vl-green.png";
|
||||
} else {
|
||||
return "/one-ui/apps/image/vl-red.png";
|
||||
}
|
||||
} else {
|
||||
return "/one-ui/apps/image/vl-grey.png";
|
||||
}
|
||||
},
|
||||
},
|
||||
props:["headerId","detailId"],
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
div.auto-verif-valid {
|
||||
padding: 0px 5px;
|
||||
padding-top: 4px;
|
||||
border-radius: 5px;
|
||||
border: solid 1px #383838;
|
||||
max-width: 70px;
|
||||
}
|
||||
div.auto-verif-valid img.icon {
|
||||
width:22px;
|
||||
height:22px;
|
||||
margin-right:5px;
|
||||
}
|
||||
</style>
|
||||
95
apps/components/oneChangePassword.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<v-dialog v-model="showdialog" persistent max-width="400">
|
||||
<v-card>
|
||||
<v-card-title style="color:#fff" class="headline grey darken-1">Ganti Password</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout pa-2 class="grey lighten-2" row>
|
||||
<v-flex xs12>
|
||||
<v-text-field :append-icon="show_saat_ini ? 'mdi-eye' : 'mdi-eye-off'"
|
||||
:type="show_saat_ini ? 'text' : 'password'"
|
||||
label="Password saat ini :"
|
||||
v-model="current_password"
|
||||
class="input-group--focused"
|
||||
@click:append="show_saat_ini = !show_saat_ini"
|
||||
></v-text-field>
|
||||
|
||||
<v-text-field :append-icon="show_new ? 'mdi-eye' : 'mdi-eye-off'"
|
||||
:type="show_new ? 'text' : 'password'"
|
||||
label="Password baru :"
|
||||
v-model="new_password"
|
||||
class="input-group--focused"
|
||||
@click:append="show_new= !show_new"
|
||||
></v-text-field>
|
||||
<v-text-field :append-icon="show_re_new ? 'mdi-eye' : 'mdi-eye-off'"
|
||||
:type="show_re_new ? 'text' : 'password'"
|
||||
label="Konfirmasi Password baru :"
|
||||
v-model="re_new_password"
|
||||
class="input-group--focused"
|
||||
@click:append="show_re_new= !show_re_new"
|
||||
></v-text-field>
|
||||
<v-alert v-show="message != ''" :type="type">
|
||||
{{message}}
|
||||
</v-alert>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="grey darken-1" flat @click="showdialog = false">Tutup</v-btn>
|
||||
<v-btn dark color="grey darken-1" @click="update_password()">Ganti Password</v-btn>
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
<style scoped>
|
||||
</style>
|
||||
<script>
|
||||
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
current_password : ''
|
||||
,new_password : ''
|
||||
,re_new_password : ''
|
||||
,show_saat_ini : false
|
||||
,show_new: false
|
||||
,show_re_new: false
|
||||
,type : 'error'
|
||||
}
|
||||
}
|
||||
,methods : {
|
||||
async update_password() {
|
||||
if (this.current_password == this.new_password) {
|
||||
this.message = "Password lama dan Password baru masih sama."
|
||||
return
|
||||
}
|
||||
if (this.re_new_password != this.new_password) {
|
||||
this.message = "Password dan Konfirmasi Password tidak sama."
|
||||
return
|
||||
}
|
||||
let prm = { token: window.one_token(), old : this.current_password ,new : this.new_password }
|
||||
await this.$store.dispatch("system/change_password",prm)
|
||||
if (this.message == "" ) {
|
||||
this.type = "success"
|
||||
this.message = "Password berhasil diubah, silahkan login lagi."
|
||||
let self = this
|
||||
setTimeout(function() {
|
||||
window.one_logout('/one-ui/test/vuex/one-login')
|
||||
},1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
,computed: {
|
||||
message : {
|
||||
get(){ return this.$store.state.system.change_password_error }
|
||||
,set(v) { this.$store.commit("system/update_change_password_error",v) }
|
||||
}
|
||||
,showdialog : {
|
||||
get(){ return this.$store.state.system.change_password_dialog }
|
||||
,set(v) { this.$store.commit("system/update_change_password_dialog",v) }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
99
apps/components/oneFooter.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<v-footer color="blue lighten-2" app>
|
||||
<one-clock class="hidden-sm-and-down"></one-clock>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="one-footer white--text">
|
||||
<code class="mb-0">Auto logged out in <span>{{ secondsUntilExpire }}</span> seconds</code>
|
||||
</span>
|
||||
</v-footer>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
span.one-footer {
|
||||
margin-right: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
IDLE_TIMEOUT: 5 * 60, // Waktu idle dalam detik
|
||||
autologoutCounter: 0, // Counter idle dalam localStorage
|
||||
_idleSecondsTimer: null,
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
secondsUntilExpire() {
|
||||
return this.IDLE_TIMEOUT - this.autologoutCounter;
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// Mengambil waktu logout yang disesuaikan jika tersedia
|
||||
if (localStorage.getItem("user")) {
|
||||
var retrievedObject = localStorage.getItem("user");
|
||||
var dtuser = JSON.parse(retrievedObject);
|
||||
if (dtuser.time_autologout && parseInt(dtuser.time_autologout) > 0) {
|
||||
this.IDLE_TIMEOUT = parseInt(dtuser.time_autologout) * 60;
|
||||
}
|
||||
}
|
||||
|
||||
// Inisialisasi autologout di localStorage jika belum ada
|
||||
if (localStorage.getItem("autologout") === null) {
|
||||
localStorage.setItem("autologout", 0);
|
||||
}
|
||||
localStorage.removeItem("logoutTriggered");
|
||||
|
||||
// Event listeners untuk reset idle timer saat ada aktivitas pengguna
|
||||
document.onclick = this.resetIdleTimer;
|
||||
document.onmousemove = this.resetIdleTimer;
|
||||
document.onkeypress = this.resetIdleTimer;
|
||||
|
||||
// Mulai interval untuk memeriksa idle time dan update counter
|
||||
this._idleSecondsTimer = setInterval(this.checkIdleTime, 1000);
|
||||
|
||||
// Event listener untuk perubahan `localStorage` guna sinkronkan logout antar tab
|
||||
window.addEventListener("storage", this.handleStorageChange);
|
||||
},
|
||||
|
||||
methods: {
|
||||
resetIdleTimer() {
|
||||
localStorage.setItem("autologout", 0);
|
||||
this.autologoutCounter = 0; // Reset counter di data reaktif
|
||||
},
|
||||
|
||||
checkIdleTime() {
|
||||
let xcounter = parseInt(localStorage.getItem("autologout"));
|
||||
xcounter++;
|
||||
localStorage.setItem("autologout", xcounter);
|
||||
this.autologoutCounter = xcounter; // Update counter di data reaktif
|
||||
|
||||
// Jika waktu idle telah habis, logout semua tab
|
||||
if (xcounter >= this.IDLE_TIMEOUT) {
|
||||
clearInterval(this._idleSecondsTimer);
|
||||
localStorage.setItem("logoutTriggered", true); // Set trigger logout
|
||||
localStorage.removeItem("autologout"); // Hapus autologout
|
||||
window.one_logout('/one-ui/test/vuex/one-login-v2') // Arahkan ke login
|
||||
}
|
||||
},
|
||||
|
||||
handleStorageChange(event) {
|
||||
if (event.key === "logoutTriggered" && event.newValue === "true") {
|
||||
// Redirect semua tab ke halaman login jika logoutTriggered berubah
|
||||
window.one_logout('/one-ui/test/vuex/one-login-v2')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
clearInterval(this._idleSecondsTimer);
|
||||
window.removeEventListener("storage", this.handleStorageChange);
|
||||
},
|
||||
|
||||
components: {
|
||||
'one-clock': httpVueLoader('./oneTanggal.vue')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
107
apps/components/oneFooter.vue--17724
Normal file
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<v-footer color="blue lighten-2" app>
|
||||
<one-clock class="hidden-sm-and-down"></one-clock>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="one-footer white--text"><code class="mb-0">Auto logged out in <span id="SecondsUntilExpire"></span> seconds</code></span>
|
||||
|
||||
</v-footer>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
span.one-footer {
|
||||
margin-right:30px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
mounted() {
|
||||
var IDLE_TIMEOUT = 5*60; //seconds
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
if(dtuser.time_autologout && parseInt(dtuser.time_autologout) > 0)
|
||||
IDLE_TIMEOUT = parseInt(dtuser.time_autologout) * 60
|
||||
}
|
||||
var _idleSecondsTimer = null;
|
||||
if (localStorage.getItem("autologout") === null) {
|
||||
localStorage.setItem("autologout", 0)
|
||||
}
|
||||
|
||||
|
||||
|
||||
document.onclick = function() {
|
||||
localStorage.setItem("autologout", 0)
|
||||
};
|
||||
|
||||
document.onmousemove = function() {
|
||||
localStorage.setItem("autologout", 0)
|
||||
};
|
||||
|
||||
document.onkeypress = function() {
|
||||
localStorage.setItem("autologout", 0)
|
||||
};
|
||||
|
||||
_idleSecondsTimer = window.setInterval(CheckIdleTime, 1000);
|
||||
|
||||
function CheckIdleTime() {
|
||||
let xcounter = parseInt(localStorage.getItem("autologout"))
|
||||
xcounter++
|
||||
localStorage.setItem("autologout", xcounter)
|
||||
//this.show_autologout = false
|
||||
|
||||
var oPanel = document.getElementById("SecondsUntilExpire");
|
||||
if (oPanel)
|
||||
oPanel.innerHTML = (IDLE_TIMEOUT - parseInt(localStorage.getItem("autologout"))) + "";
|
||||
if (parseInt(localStorage.getItem("autologout")) >= IDLE_TIMEOUT) {
|
||||
window.clearInterval(_idleSecondsTimer);
|
||||
localStorage.removeItem("autologout");
|
||||
window.one_logout('/one-ui/test/vuex/one-login')
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-clock' : httpVueLoader('./oneTanggal.vue')
|
||||
}
|
||||
}
|
||||
function one_verif() {
|
||||
let url_redir = "/one-ui/";
|
||||
let verif = async function (token) {
|
||||
try {
|
||||
var resp = await axios.post("/one-api/v1/system/verify/do", {
|
||||
token: token,
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText,
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
let x = async () => {
|
||||
let url_redir = "/one-ui/";
|
||||
try {
|
||||
let resp = await verif(window.one_token());
|
||||
console.log('Response',resp);
|
||||
return;
|
||||
|
||||
if (resp.status != "OK") {
|
||||
window.localStorage.removeItem("token");
|
||||
window.localStorage.removeItem("user");
|
||||
location.replace(url_redir);
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
x();
|
||||
}
|
||||
|
||||
//one_verif();
|
||||
</script>
|
||||
65
apps/components/oneFooter.vue--311024
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<v-footer color="blue lighten-2" app>
|
||||
<one-clock class="hidden-sm-and-down"></one-clock>
|
||||
<v-spacer></v-spacer>
|
||||
<!--<span class="one-footer white--text"><code class="mb-0">Auto logged out in <span id="SecondsUntilExpire"></span> seconds</code></span>-->
|
||||
|
||||
</v-footer>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
span.one-footer {
|
||||
margin-right:30px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
mounted() {
|
||||
|
||||
},
|
||||
components: {
|
||||
'one-clock' : httpVueLoader('./oneTanggal.vue')
|
||||
}
|
||||
}
|
||||
function one_verif() {
|
||||
let url_redir = "/one-ui/";
|
||||
let verif = async function (token) {
|
||||
try {
|
||||
var resp = await axios.post("/one-api/v1/system/verify/do", {
|
||||
token: token,
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText,
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
let x = async () => {
|
||||
let url_redir = "/one-ui/";
|
||||
try {
|
||||
let resp = await verif(window.one_token());
|
||||
console.log('Response',resp);
|
||||
return;
|
||||
|
||||
if (resp.status != "OK") {
|
||||
window.localStorage.removeItem("token");
|
||||
window.localStorage.removeItem("user");
|
||||
location.replace(url_redir);
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
x();
|
||||
}
|
||||
|
||||
//one_verif();
|
||||
</script>
|
||||
100
apps/components/oneFooter.vue-170123
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<v-footer color="blue lighten-2" app>
|
||||
<one-clock></one-clock>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="one-footer white--text"><code class="mb-0">Auto logged out in <span id="SecondsUntilExpire"></span> seconds</code></span>
|
||||
|
||||
</v-footer>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
span.one-footer {
|
||||
margin-right:30px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
mounted() {
|
||||
var IDLE_TIMEOUT = 5*60; //seconds
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
if(dtuser.time_autologout && parseInt(dtuser.time_autologout) > 0)
|
||||
IDLE_TIMEOUT = parseInt(dtuser.time_autologout) * 60
|
||||
}
|
||||
var _idleSecondsTimer = null;
|
||||
var _idleSecondsCounter = 0;
|
||||
|
||||
document.onclick = function() {
|
||||
_idleSecondsCounter = 0;
|
||||
};
|
||||
|
||||
document.onmousemove = function() {
|
||||
_idleSecondsCounter = 0;
|
||||
};
|
||||
|
||||
document.onkeypress = function() {
|
||||
_idleSecondsCounter = 0;
|
||||
};
|
||||
|
||||
_idleSecondsTimer = window.setInterval(CheckIdleTime, 1000);
|
||||
|
||||
function CheckIdleTime() {
|
||||
_idleSecondsCounter++;
|
||||
//this.show_autologout = false
|
||||
|
||||
var oPanel = document.getElementById("SecondsUntilExpire");
|
||||
if (oPanel)
|
||||
oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + "";
|
||||
if (_idleSecondsCounter >= IDLE_TIMEOUT) {
|
||||
window.clearInterval(_idleSecondsTimer);
|
||||
window.one_logout('/one-ui/test/vuex/one-login')
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-clock' : httpVueLoader('./oneTanggal.vue')
|
||||
}
|
||||
}
|
||||
function one_verif() {
|
||||
let url_redir = "/one-ui/";
|
||||
let verif = async function (token) {
|
||||
try {
|
||||
var resp = await axios.post("/one-api/v1/system/verify/do", {
|
||||
token: token,
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText,
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
let x = async () => {
|
||||
let url_redir = "/one-ui/";
|
||||
try {
|
||||
let resp = await verif(window.one_token());
|
||||
console.log('Response',resp);
|
||||
return;
|
||||
|
||||
if (resp.status != "OK") {
|
||||
window.localStorage.removeItem("token");
|
||||
window.localStorage.removeItem("user");
|
||||
location.replace(url_redir);
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
x();
|
||||
}
|
||||
|
||||
//one_verif();
|
||||
</script>
|
||||
35
apps/components/oneFooterlogin.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<v-footer color="blue lighten-2" app>
|
||||
|
||||
<span class="one-footer white--text" >
|
||||
SURABAYA -
|
||||
JAKARTA -
|
||||
BANDUNG -
|
||||
CIMAHI -
|
||||
CIREBON -
|
||||
MEDAN -
|
||||
PADANG -
|
||||
PALEMBANG -
|
||||
SEMARANG -
|
||||
YOGYAKARTA -
|
||||
MADIUN -
|
||||
BALIKPAPAN -
|
||||
PEKANBARU -
|
||||
MAGELANG -
|
||||
MAKASSAR -
|
||||
TEGAL -
|
||||
SALATIGA -
|
||||
MANADO</span>
|
||||
</v-footer>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
span.one-footer {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
}
|
||||
</script>
|
||||
76
apps/components/oneFpp.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-btn
|
||||
color="primary"
|
||||
:disabled="is_disabled"
|
||||
@click="viewfpp= true"
|
||||
>
|
||||
{{button_title}}
|
||||
</v-btn>
|
||||
|
||||
<one-dialog-print :title="printtitle" :width="printwidth" :height="550" :status="viewfpp" :urlprint="urlfpp" @close-dialog-print="viewfpp = false">
|
||||
</one-dialog-print>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
async function checkFpp(param, id) {
|
||||
try {
|
||||
var resp = await axios.get("/one-api/file_upload/get_fpp/" + id);
|
||||
if (resp.status != 200) {
|
||||
param.button_title = "Error Checking Fpp : " + resp.statusText;
|
||||
return;
|
||||
}
|
||||
let data = resp.data;
|
||||
if (data.rows.length > 0) {
|
||||
param.button_title = "Lihat FPP";
|
||||
param.is_disabled = false;
|
||||
param.urlfpp = data.rows[0].fppUrl;
|
||||
return;
|
||||
}
|
||||
param.button_title = "FPP belum di upload";
|
||||
} catch(e) {
|
||||
param.button_title = "Error Checking Fpp : " + e.message;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-print':httpVueLoader('../../common/oneDialogPrintX.vue')
|
||||
},
|
||||
props: ["id"],
|
||||
data () {
|
||||
return {
|
||||
urlfpp:'',
|
||||
printtitle:'View FPP',
|
||||
printwidth:'60%',
|
||||
isLoading:false,
|
||||
viewfpp: false,
|
||||
button_title: "Checking FPP",
|
||||
is_disabled:true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('Mounted',this.id);
|
||||
let self = this;
|
||||
let n = parseInt(this.id.orderHeaderID.toString());
|
||||
if (n == 0) return;
|
||||
self.urlfpp = '';
|
||||
self.is_disabled = true;
|
||||
self.button_title = "Checking FPP"
|
||||
checkFpp(self,n);
|
||||
},
|
||||
watch: {
|
||||
async id(n,o) {
|
||||
console.log('Watch FPP ID', n );
|
||||
let self = this;
|
||||
if (n == 0) return;
|
||||
self.urlfpp = '';
|
||||
self.is_disabled = true;
|
||||
self.button_title = "Checking FPP"
|
||||
checkFpp(self,n.orderHeaderID);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
212
apps/components/oneMenuDrawer-bkp.vue
Normal file
@@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<v-navigation-drawer v-model="drawer" fixed app>
|
||||
<v-list>
|
||||
<!-- IF NO CHILD -->
|
||||
<template
|
||||
v-for="(lev_0, i) in level_0"
|
||||
>
|
||||
<v-list-tile
|
||||
:key="i"
|
||||
v-show="!level_1['p_'+lev_0.id] && lev_0.is_parent=='N'"
|
||||
@click="goTo(lev_0.url)">
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<!-- HAVING CHILDREN -->
|
||||
<template
|
||||
v-for="(lev_0, i) in level_0"
|
||||
>
|
||||
<v-list-group
|
||||
v-bind:key="i"
|
||||
prepend-icon="account_circle"
|
||||
:value="lev_0.state"
|
||||
v-show="level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile>
|
||||
<v-list-tile-title>{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 1 STARTS HERE -->
|
||||
<!-- NOT HAVING CHILD -->
|
||||
<template
|
||||
v-for="(lev_1, j) in level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<v-list-tile
|
||||
v-bind:key="j"
|
||||
v-show="!level_2['p_'+lev_1.id] && lev_1.is_parent=='N'"
|
||||
sub-group
|
||||
no-action
|
||||
@click="goTo(lev_1.url)"
|
||||
>
|
||||
<v-list-tile-action>
|
||||
<!-- <v-icon>home</v-icon> -->
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- HAVING CHILD -->
|
||||
<template
|
||||
v-for="(lev_1, j) in level_1['p_'+lev_0.id]"
|
||||
>
|
||||
|
||||
<v-list-group
|
||||
v-bind:key="j"
|
||||
:value="lev_1.state"
|
||||
v-show="level_2['p_'+lev_1.id]"
|
||||
sub-group
|
||||
no-action
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile>
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 2 STARTS HERE -->
|
||||
<template
|
||||
v-for="(lev_2, k) in level_2['p_'+lev_1.id]"
|
||||
>
|
||||
<v-list-tile
|
||||
:key="k"
|
||||
@click="goTo(lev_2.url)">
|
||||
<!-- <v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action> -->
|
||||
<v-list-tile-title>{{ lev_2.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</template>
|
||||
<!-- END OF LEVEL 2 -->
|
||||
|
||||
</v-list-group>
|
||||
</template>
|
||||
<!-- END OF LEVEL 1 -->
|
||||
|
||||
</v-list-group>
|
||||
</template>
|
||||
</v-list>
|
||||
|
||||
<!-- <v-list>
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Home</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group
|
||||
prepend-icon="account_circle"
|
||||
value="true"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile>
|
||||
<v-list-tile-title>Users</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
<v-list-group
|
||||
no-action
|
||||
sub-group
|
||||
value="true"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile>
|
||||
<v-list-tile-title>Admin</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<v-list-tile
|
||||
v-for="(admin, i) in admins"
|
||||
:key="i"
|
||||
@click=""
|
||||
>
|
||||
<v-list-tile-title v-text="admin[0]"></v-list-tile-title>
|
||||
<v-list-tile-action>
|
||||
<v-icon v-text="admin[1]"></v-icon>
|
||||
</v-list-tile-action>
|
||||
</v-list-tile>
|
||||
</v-list-group>
|
||||
|
||||
<v-list-group
|
||||
sub-group
|
||||
no-action
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile>
|
||||
<v-list-tile-title>Actions</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
<v-list-tile
|
||||
v-for="(crud, i) in cruds"
|
||||
:key="i"
|
||||
@click=""
|
||||
>
|
||||
<v-list-tile-title v-text="crud[0]"></v-list-tile-title>
|
||||
<v-list-tile-action>
|
||||
<v-icon v-text="crud[1]"></v-icon>
|
||||
</v-list-tile-action>
|
||||
</v-list-tile>
|
||||
</v-list-group>
|
||||
</v-list-group>
|
||||
</v-list> -->
|
||||
<!-- <v-list dense>
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Home</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>contact_mail</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Contact</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-list> -->
|
||||
</v-navigation-drawer>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
drawer: Boolean
|
||||
},
|
||||
|
||||
computed : {
|
||||
level_0 () {
|
||||
return this.$store.state.system.menu_level_0
|
||||
},
|
||||
|
||||
level_1 () {
|
||||
return this.$store.state.system.menu_level_1
|
||||
},
|
||||
|
||||
level_2 () {
|
||||
return this.$store.state.system.menu_level_2
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('system/get_menu')
|
||||
},
|
||||
|
||||
methods : {
|
||||
goTo (url) {
|
||||
window.location = BASE_URL + '/one-ui/' + url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
154
apps/components/oneMenuDrawer.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<v-navigation-drawer temporary class="blue lighten-2" v-model="xdrawer" dark fixed app>
|
||||
<v-list>
|
||||
|
||||
<!-- LEVEL 0 -->
|
||||
<template
|
||||
v-for="(lev_0, i) in level_0"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
:key="lev_0.id + 10000"
|
||||
v-if="!level_1['p_'+lev_0.id] && lev_0.is_parent=='N'"
|
||||
@click="goTo(lev_0.url)">
|
||||
<v-list-tile-action>
|
||||
<v-icon>{{ lev_0.icon }}</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group
|
||||
:key="lev_0.id"
|
||||
:prepend-icon="lev_0.icon"
|
||||
:value="lev_0.state"
|
||||
v-if="level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-title>{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 1 -->
|
||||
<template
|
||||
v-for="(lev_1, j) in level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
:key="lev_1.id + 10000"
|
||||
v-if="!level_2['p_'+lev_1.id] && lev_1.is_parent=='N'"
|
||||
sub-group
|
||||
no-action
|
||||
@click="goTo(lev_1.url)"
|
||||
>
|
||||
<v-list-tile-action>
|
||||
<!-- <v-icon>home</v-icon> -->
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group
|
||||
:key="lev_1.id"
|
||||
:value="lev_1.state"
|
||||
v-show="level_2['p_'+lev_1.id]"
|
||||
sub-group
|
||||
no-action
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile>
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 2 -->
|
||||
<template
|
||||
v-for="(lev_2, k) in level_2['p_'+lev_1.id]"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
:key="lev_2.id"
|
||||
@click="goTo(lev_2.url)">
|
||||
<!-- <v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action> -->
|
||||
<v-list-tile-title>{{ lev_2.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</template>
|
||||
</v-list-group>
|
||||
|
||||
</template>
|
||||
|
||||
</v-list-group>
|
||||
|
||||
</template>
|
||||
</v-list>
|
||||
</v-navigation-drawer>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.tile {
|
||||
margin: 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.tile:hover {
|
||||
background-color: #1E88E5;
|
||||
}
|
||||
.tile:active {
|
||||
background: #bec5b7;
|
||||
}
|
||||
.v-list__group__header__prepend-icon .v-icon {
|
||||
color: white;
|
||||
}
|
||||
.v-list__tile__title:hover {
|
||||
color: #BBDEFB;
|
||||
}
|
||||
|
||||
.v-navigation-drawer {
|
||||
z-index: 1003;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.v-overlay--active {
|
||||
z-index: 1002;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
drawer: Boolean
|
||||
},
|
||||
|
||||
computed : {
|
||||
xdrawer: {
|
||||
get() {
|
||||
return this.drawer
|
||||
},
|
||||
set(v) {
|
||||
this.$emit("togleDrawer")
|
||||
}
|
||||
},
|
||||
level_0 () {
|
||||
return this.$store.state.system.menu_level_0
|
||||
},
|
||||
|
||||
level_1 () {
|
||||
return this.$store.state.system.menu_level_1
|
||||
},
|
||||
|
||||
level_2 () {
|
||||
return this.$store.state.system.menu_level_2
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('system/get_menu')
|
||||
},
|
||||
|
||||
methods : {
|
||||
goTo (url) {
|
||||
window.location = BASE_URL + '/one-ui/' + url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
134
apps/components/oneMenuDrawer2.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<v-navigation-drawer temporary class="blue lighten-2" v-model="drawer" dark fixed app>
|
||||
<v-list>
|
||||
|
||||
<!-- LEVEL 0 -->
|
||||
<template
|
||||
v-for="(lev_0, i) in level_0"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
:key="i"
|
||||
v-if="!level_1['p_'+lev_0.id] && lev_0.is_parent=='N'"
|
||||
@click="goTo(lev_0.url)">
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group
|
||||
v-bind:key="i"
|
||||
:prepend-icon="lev_0.icon"
|
||||
:value="lev_0.state"
|
||||
v-if="level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-title>{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 1 -->
|
||||
<template
|
||||
v-for="(lev_1, j) in level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
v-bind:key="j"
|
||||
v-if="!level_2['p_'+lev_1.id] && lev_1.is_parent=='N'"
|
||||
sub-group
|
||||
no-action
|
||||
@click="goTo(lev_1.url)"
|
||||
>
|
||||
<v-list-tile-action>
|
||||
<!-- <v-icon>home</v-icon> -->
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group
|
||||
v-bind:key="j"
|
||||
:value="lev_1.state"
|
||||
v-show="level_2['p_'+lev_1.id]"
|
||||
sub-group
|
||||
no-action
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile>
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 2 -->
|
||||
<template
|
||||
v-for="(lev_2, k) in level_2['p_'+lev_1.id]"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
:key="k"
|
||||
@click="goTo(lev_2.url)">
|
||||
<!-- <v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action> -->
|
||||
<v-list-tile-title>{{ lev_2.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</template>
|
||||
</v-list-group>
|
||||
|
||||
</template>
|
||||
|
||||
</v-list-group>
|
||||
|
||||
</template>
|
||||
</v-list>
|
||||
</v-navigation-drawer>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.tile {
|
||||
margin: 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.tile:hover {
|
||||
background-color: #1E88E5;
|
||||
}
|
||||
.tile:active {
|
||||
background: #bec5b7;
|
||||
}
|
||||
.v-list__group__header__prepend-icon .v-icon {
|
||||
color: white;
|
||||
}
|
||||
.v-list__tile__title:hover {
|
||||
color: #BBDEFB;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
drawer: Boolean
|
||||
},
|
||||
|
||||
computed : {
|
||||
level_0 () {
|
||||
return this.$store.state.system.menu_level_0
|
||||
},
|
||||
|
||||
level_1 () {
|
||||
return this.$store.state.system.menu_level_1
|
||||
},
|
||||
|
||||
level_2 () {
|
||||
return this.$store.state.system.menu_level_2
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('system/get_menu')
|
||||
},
|
||||
|
||||
methods : {
|
||||
goTo (url) {
|
||||
window.location = BASE_URL + '/one-ui/' + url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
229
apps/components/oneMenuDrawerGlobal.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<v-navigation-drawer temporary class="blue lighten-2" v-model="drawer" dark fixed app>
|
||||
<v-list>
|
||||
<!-- IF NO CHILD -->
|
||||
<template
|
||||
v-for="(lev_0, i) in level_0"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
:key="i"
|
||||
v-show="!level_1['p_'+lev_0.id]"
|
||||
@click="goTo(lev_0.url)">
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title >{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<!-- HAVING CHILDREN -->
|
||||
<template
|
||||
v-for="(lev_0, i) in level_0"
|
||||
>
|
||||
<v-list-group
|
||||
v-bind:key="i"
|
||||
prepend-icon="account_circle"
|
||||
:value="lev_0.state"
|
||||
v-show="level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-title>{{ lev_0.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 1 STARTS HERE -->
|
||||
<!-- NOT HAVING CHILD -->
|
||||
<template
|
||||
v-for="(lev_1, j) in level_1['p_'+lev_0.id]"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
v-bind:key="j"
|
||||
v-show="!level_2['p_'+lev_1.id]"
|
||||
sub-group
|
||||
no-action
|
||||
@click="goTo(lev_1.url)"
|
||||
>
|
||||
<v-list-tile-action>
|
||||
<!-- <v-icon>home</v-icon> -->
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- HAVING CHILD -->
|
||||
<template
|
||||
v-for="(lev_1, j) in level_1['p_'+lev_0.id]"
|
||||
>
|
||||
|
||||
<v-list-group
|
||||
v-bind:key="j"
|
||||
:value="lev_1.state"
|
||||
v-show="level_2['p_'+lev_1.id]"
|
||||
sub-group
|
||||
no-action
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-title>{{ lev_1.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<!-- LEVEL 2 STARTS HERE -->
|
||||
<template
|
||||
v-for="(lev_2, k) in level_2['p_'+lev_1.id]"
|
||||
>
|
||||
<v-list-tile class="tile"
|
||||
:key="k"
|
||||
@click="goTo(lev_2.url)">
|
||||
<!-- <v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action> -->
|
||||
<v-list-tile-title>{{ lev_2.name }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</template>
|
||||
<!-- END OF LEVEL 2 -->
|
||||
|
||||
</v-list-group>
|
||||
</template>
|
||||
<!-- END OF LEVEL 1 -->
|
||||
|
||||
</v-list-group>
|
||||
</template>
|
||||
</v-list>
|
||||
|
||||
<!-- <v-list>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Home</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group
|
||||
prepend-icon="account_circle"
|
||||
value="true"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-title>Users</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
<v-list-group
|
||||
no-action
|
||||
sub-group
|
||||
value="true"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-title>Admin</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
|
||||
<v-list-tile
|
||||
v-for="(admin, i) in admins"
|
||||
:key="i"
|
||||
@click=""
|
||||
>
|
||||
<v-list-tile-title v-text="admin[0]"></v-list-tile-title>
|
||||
<v-list-tile-action>
|
||||
<v-icon v-text="admin[1]"></v-icon>
|
||||
</v-list-tile-action>
|
||||
</v-list-tile>
|
||||
</v-list-group>
|
||||
|
||||
<v-list-group
|
||||
sub-group
|
||||
no-action
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-title>Actions</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</template>
|
||||
<v-list-tile
|
||||
v-for="(crud, i) in cruds"
|
||||
:key="i"
|
||||
@click=""
|
||||
>
|
||||
<v-list-tile-title v-text="crud[0]"></v-list-tile-title>
|
||||
<v-list-tile-action>
|
||||
<v-icon v-text="crud[1]"></v-icon>
|
||||
</v-list-tile-action>
|
||||
</v-list-tile class="tile">
|
||||
</v-list-group>
|
||||
</v-list-group>
|
||||
</v-list> -->
|
||||
<!-- <v-list dense>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Home</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile class="tile">
|
||||
<v-list-tile-action>
|
||||
<v-icon>contact_mail</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Contact</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-list> -->
|
||||
</v-navigation-drawer>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.tile {
|
||||
margin: 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.tile:hover {
|
||||
background-color: #1E88E5;
|
||||
}
|
||||
.tile:active {
|
||||
background: #bec5b7;
|
||||
}
|
||||
.v-list__group__header__prepend-icon .v-icon {
|
||||
color: #3b60f2;
|
||||
}
|
||||
.v-list__tile__title:hover {
|
||||
color: #BBDEFB;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
drawer: Boolean
|
||||
},
|
||||
|
||||
computed : {
|
||||
level_0 () {
|
||||
return this.$store.state.menu.menu_level_0
|
||||
},
|
||||
|
||||
level_1 () {
|
||||
return this.$store.state.menu.menu_level_1
|
||||
},
|
||||
|
||||
level_2 () {
|
||||
return this.$store.state.menu.menu_level_2
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('menu/get_menu')
|
||||
},
|
||||
|
||||
methods : {
|
||||
goTo (url) {
|
||||
window.location = BASE_URL + '/one-ui/' + url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
67
apps/components/oneMergeReport.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<tmplate>
|
||||
<v-dialog v-model="dialog_choose" width="350px">
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
Test Card
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="info"
|
||||
flat
|
||||
@click="selectReport()"
|
||||
>
|
||||
Pilih
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-dialog>
|
||||
<v-btn
|
||||
color="info"
|
||||
flat
|
||||
@click="dialog_choose = true"
|
||||
>
|
||||
Gabung Laporan
|
||||
</v-btn>
|
||||
<one-dialog-print :title="printtitle" :width="printwidth" :height="550" :status="openprint" :urlprint="urlprint" @close-dialog-print="openprint= false">
|
||||
</one-dialog-print>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-print':httpVueLoader('../../common/oneDialogPrintX.vue'),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
dialog_choose:false,
|
||||
urlprint:'',
|
||||
printtitle:'Merge Report',
|
||||
printwidth:'60%',
|
||||
isLoading:false,
|
||||
openprint: false,
|
||||
orderHeaderID: 0,
|
||||
selectedReport: [],
|
||||
reports : [ {id:'lab',name:'Hasil Lab'}, {id:'xray',name:'Hasil Rontgent'}, {id:'ecg',name:'Hasil Ecg'} ]
|
||||
}
|
||||
},
|
||||
props:["id"],
|
||||
mounted() {
|
||||
checkReport()//this.$store.dispatch("paymentnew/lookup_type")
|
||||
},
|
||||
methods : {
|
||||
selectReport() {
|
||||
console.log('SelectedReport', selectedReport);
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
async id(n,o) {
|
||||
if (n == 0) return;
|
||||
console.log('Check Report');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
131
apps/components/oneNavbarComponent-bkp.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<span>
|
||||
<one-menu-drawer :drawer="drawer" > </one-menu-drawer>
|
||||
<one-menu-notification :drawer="drawer_notification" > </one-menu-notification>
|
||||
<v-toolbar color="blue lighten-2" dark fixed app>
|
||||
<v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-icon>
|
||||
<h1>ONE</h1>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<a href="#" style="text-decoration:none;color:#fff;font-size:22px; margin-right:15px">{{ xusername }}</a>
|
||||
<v-badge color="red">
|
||||
<template v-slot:badge>
|
||||
<span>9</span>
|
||||
</template>
|
||||
<v-btn icon @click="drawer_notification = !drawer_notification" flat>
|
||||
|
||||
<v-icon
|
||||
medium
|
||||
|
||||
>
|
||||
notifications
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
</v-badge>
|
||||
|
||||
|
||||
|
||||
<!-- <v-btn class="ml-4" icon>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn> -->
|
||||
|
||||
<!-- PROFILE MENU -->
|
||||
<v-menu
|
||||
v-model="menu"
|
||||
:close-on-content-click="true"
|
||||
:nudge-width="200"
|
||||
offset-overflow
|
||||
left
|
||||
bottom
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
class="ml-4" icon
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-tile avatar>
|
||||
<v-list-tile-avatar>
|
||||
<img src="https://cdn.vuetifyjs.com/images/john.jpg" alt="John">
|
||||
</v-list-tile-avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ xusername }}</v-list-tile-title>
|
||||
<v-list-tile-sub-title>Founder of Vuetify.js</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
|
||||
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-list>
|
||||
<v-list-tile
|
||||
@click="logout"
|
||||
>
|
||||
<v-list-tile-action>
|
||||
<v-icon>no_meeting_room</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Log Out</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
<!-- <v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-switch v-model="hints" color="purple"></v-switch>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Enable hints</v-list-tile-title>
|
||||
</v-list-tile> -->
|
||||
</v-list>
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-menu>
|
||||
<!-- End of PROFILE MENU -->
|
||||
|
||||
</v-toolbar>
|
||||
</template>
|
||||
<style scoped>
|
||||
.v-badge__badge{
|
||||
top:0px;
|
||||
right:0px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-menu-drawer' : httpVueLoader('./oneMenuDrawer.vue'),
|
||||
'one-menu-notification' : httpVueLoader('./oneNotificationDrawer.vue')
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
drawer: false,
|
||||
drawer_notification: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
xusername() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_UserUsername
|
||||
}
|
||||
return un
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
logout () {
|
||||
window.one_logout('/one-ui/test/vuex/one-login')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
177
apps/components/oneNavbarComponent.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<div>
|
||||
<one-menu-drawer :drawer="drawer" > </one-menu-drawer>
|
||||
<one-menu-notification :drawer="drawer_notification" > </one-menu-notification>
|
||||
<v-toolbar color="blue lighten-2" dark fixed app>
|
||||
<v-toolbar-side-icon @click.stop="togleDrawer()"></v-toolbar-side-icon>
|
||||
<v-layout row >
|
||||
<v-flex class="pt-2" xs8>
|
||||
<p class="mb-0"><a href="#" style="padding-bottom:0px;margin-bottom:0px;text-decoration:none;color:#fff;font-size:18px; font-weight:bold;">CPONE</a> </p>
|
||||
<p class="hidden-sm-and-down mb-0"><span style="text-decoration:none;color:#fff;font-size:12px;" class="ml-0 mt-0 bread-crumb">{{bread_crumb}}</span></p>
|
||||
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs4 class="mt-2 text-xs-right align-right">
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="#" class="mt-3 hidden-sm-and-down" style="min-height:10px;text-decoration:none;color:#fff;font-size:22px; margin-right:15px">{{ xusername }}</a>
|
||||
<v-badge color="red">
|
||||
|
||||
|
||||
</v-badge>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <v-btn class="ml-4" icon>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn> -->
|
||||
|
||||
<!-- PROFILE MENU -->
|
||||
<v-menu
|
||||
:close-on-content-click="true"
|
||||
:nudge-width="200"
|
||||
offset-overflow
|
||||
left
|
||||
bottom
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
class="" icon
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-tile avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ xusername }}</v-list-tile-title>
|
||||
<v-list-tile-sub-title>{{xstaffname}}</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-list>
|
||||
<v-list-tile @click="change_password" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>security</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Change Password</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
<v-list>
|
||||
<v-list-tile @click="logout" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>no_meeting_room</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Log Out</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-menu>
|
||||
<!-- End of PROFILE MENU -->
|
||||
|
||||
<one-cp></one-cp>
|
||||
</v-toolbar>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<style scoped>
|
||||
.bread-crumb {
|
||||
margin-left:20px;
|
||||
font-weight:normal!important;
|
||||
}
|
||||
.v-badge__badge{
|
||||
top:0px;
|
||||
right:0px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-menu-drawer' : httpVueLoader('./oneMenuDrawer.vue'),
|
||||
'one-cp' : httpVueLoader('./oneChangePassword.vue'),
|
||||
'one-menu-notification' : httpVueLoader('./oneNotificationDrawer.vue')
|
||||
},
|
||||
|
||||
data: function() {
|
||||
return {
|
||||
drawer: false,
|
||||
drawer_notification: false
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
is_page_allowed : function(new_ipa, old_ipa) {
|
||||
if(! new_ipa ) {
|
||||
var dashboard = this.$store.state.system.dashboard
|
||||
if (dashboard == "") {
|
||||
//this.logout()
|
||||
console.log('go-to','logout')
|
||||
} else {
|
||||
//window.location.href = '/' + dashboard
|
||||
console.log('go-to dashboard',dashboard)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
is_page_allowed() {
|
||||
return this.$store.state.system.is_page_allowed
|
||||
},
|
||||
bread_crumb() {
|
||||
return this.$store.state.system.bread_crumb
|
||||
},
|
||||
xusername() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_UserUsername
|
||||
}
|
||||
return un
|
||||
},
|
||||
xstaffname() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_StaffName
|
||||
}
|
||||
return un
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
togleDrawer() {
|
||||
this.drawer = ! this.drawer
|
||||
},
|
||||
change_password() {
|
||||
this.$store.commit("system/update_change_password_dialog",true)
|
||||
},
|
||||
logout () {
|
||||
window.one_logout('/home')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
168
apps/components/oneNavbarComponent.vue-010320
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<span>
|
||||
<one-menu-drawer :drawer="drawer" > </one-menu-drawer>
|
||||
<one-menu-notification :drawer="drawer_notification" > </one-menu-notification>
|
||||
<v-toolbar color="blue lighten-2" dark fixed app>
|
||||
<v-toolbar-side-icon @click.stop="togleDrawer()"></v-toolbar-side-icon>
|
||||
<h1>ONE</h1>
|
||||
<h2 class="bread-crumb">{{bread_crumb}}</h2>
|
||||
<v-spacer></v-spacer>
|
||||
<a href="#" style="text-decoration:none;color:#fff;font-size:22px; margin-right:15px">{{ xusername }}</a>
|
||||
<v-badge color="red">
|
||||
<!--
|
||||
<template v-slot:badge>
|
||||
<span>9</span>
|
||||
</template>
|
||||
-->
|
||||
<v-btn icon @click.stop="drawer_notification = !drawer_notification" flat>
|
||||
<v-icon
|
||||
medium
|
||||
>
|
||||
notifications
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
</v-badge>
|
||||
|
||||
|
||||
<!-- <v-btn class="ml-4" icon>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn> -->
|
||||
|
||||
<!-- PROFILE MENU -->
|
||||
<v-menu
|
||||
:close-on-content-click="true"
|
||||
:nudge-width="200"
|
||||
offset-overflow
|
||||
left
|
||||
bottom
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
class="ml-4" icon
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-tile avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ xusername }}</v-list-tile-title>
|
||||
<v-list-tile-sub-title>{{xstaffname}}</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-list>
|
||||
<v-list-tile @click="change_password" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>security</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Change Password</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
<v-list>
|
||||
<v-list-tile @click="logout" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>no_meeting_room</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Log Out</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-menu>
|
||||
<!-- End of PROFILE MENU -->
|
||||
|
||||
<one-cp></one-cp>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
<style scoped>
|
||||
.bread-crumb {
|
||||
margin-left:20px;
|
||||
font-weight:normal!important;
|
||||
}
|
||||
.v-badge__badge{
|
||||
top:0px;
|
||||
right:0px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-menu-drawer' : httpVueLoader('./oneMenuDrawer.vue'),
|
||||
'one-cp' : httpVueLoader('./oneChangePassword.vue'),
|
||||
'one-menu-notification' : httpVueLoader('./oneNotificationDrawer.vue')
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
drawer: false,
|
||||
drawer_notification: false
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
is_page_allowed : function(new_ipa, old_ipa) {
|
||||
if(! new_ipa ) {
|
||||
var dashboard = this.$store.state.system.dashboard
|
||||
if (dashboard == "") {
|
||||
//this.logout()
|
||||
console.log('go-to','logout')
|
||||
} else {
|
||||
//window.location.href = '/' + dashboard
|
||||
console.log('go-to dashboard',dashboard)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
is_page_allowed() {
|
||||
return this.$store.state.system.is_page_allowed
|
||||
},
|
||||
bread_crumb() {
|
||||
return this.$store.state.system.bread_crumb
|
||||
},
|
||||
xusername() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_UserUsername
|
||||
}
|
||||
return un
|
||||
},
|
||||
xstaffname() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_StaffName
|
||||
}
|
||||
return un
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
togleDrawer() {
|
||||
this.drawer = ! this.drawer
|
||||
},
|
||||
change_password() {
|
||||
this.$store.commit("system/update_change_password_dialog",true)
|
||||
},
|
||||
logout () {
|
||||
window.one_logout('/one-ui/test/vuex/one-login')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
182
apps/components/oneNavbarComponent.vue070524
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<div>
|
||||
<one-menu-drawer :drawer="drawer" > </one-menu-drawer>
|
||||
<one-menu-notification :drawer="drawer_notification" > </one-menu-notification>
|
||||
<v-toolbar color="blue lighten-2" dark fixed app>
|
||||
<v-toolbar-side-icon class="hidden-sm-and-down" @click.stop="togleDrawer()"></v-toolbar-side-icon>
|
||||
<v-layout row >
|
||||
<v-flex class="pt-2" xs8>
|
||||
<p class="mb-0"><a href="#" style="padding-bottom:0px;margin-bottom:0px;text-decoration:none;color:#fff;font-size:18px; font-weight:bold;">CPONE</a> </p>
|
||||
<p class="mb-0"><span style="text-decoration:none;color:#fff;font-size:12px;" class="ml-0 mt-0 bread-crumb">{{bread_crumb}}</span></p>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs4 class="mt-2 text-xs-right align-right">
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="#" class="mt-3" style="min-height:10px;text-decoration:none;color:#fff;font-size:22px; margin-right:15px">{{ xusername }}</a>
|
||||
<v-badge color="red">
|
||||
|
||||
<v-btn class="pt-0 pb-2" icon @click.stop="drawer_notification = !drawer_notification" flat>
|
||||
<v-icon
|
||||
medium
|
||||
>
|
||||
notifications
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
</v-badge>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <v-btn class="ml-4" icon>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn> -->
|
||||
|
||||
<!-- PROFILE MENU -->
|
||||
<v-menu
|
||||
:close-on-content-click="true"
|
||||
:nudge-width="200"
|
||||
offset-overflow
|
||||
left
|
||||
bottom
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
class="" icon
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-tile avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ xusername }}</v-list-tile-title>
|
||||
<v-list-tile-sub-title>{{xstaffname}}</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-list>
|
||||
<v-list-tile @click="change_password" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>security</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Change Password</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
<v-list>
|
||||
<v-list-tile @click="logout" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>no_meeting_room</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Log Out</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-menu>
|
||||
<!-- End of PROFILE MENU -->
|
||||
|
||||
<one-cp></one-cp>
|
||||
</v-toolbar>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<style scoped>
|
||||
.bread-crumb {
|
||||
margin-left:20px;
|
||||
font-weight:normal!important;
|
||||
}
|
||||
.v-badge__badge{
|
||||
top:0px;
|
||||
right:0px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-menu-drawer' : httpVueLoader('./oneMenuDrawer.vue'),
|
||||
'one-cp' : httpVueLoader('./oneChangePassword.vue'),
|
||||
'one-menu-notification' : httpVueLoader('./oneNotificationDrawer.vue')
|
||||
},
|
||||
|
||||
data: function() {
|
||||
return {
|
||||
drawer: false,
|
||||
drawer_notification: false
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
is_page_allowed : function(new_ipa, old_ipa) {
|
||||
if(! new_ipa ) {
|
||||
var dashboard = this.$store.state.system.dashboard
|
||||
if (dashboard == "") {
|
||||
//this.logout()
|
||||
console.log('go-to','logout')
|
||||
} else {
|
||||
//window.location.href = '/' + dashboard
|
||||
console.log('go-to dashboard',dashboard)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
is_page_allowed() {
|
||||
return this.$store.state.system.is_page_allowed
|
||||
},
|
||||
bread_crumb() {
|
||||
return this.$store.state.system.bread_crumb
|
||||
},
|
||||
xusername() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_UserUsername
|
||||
}
|
||||
return un
|
||||
},
|
||||
xstaffname() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_StaffName
|
||||
}
|
||||
return un
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
togleDrawer() {
|
||||
this.drawer = ! this.drawer
|
||||
},
|
||||
change_password() {
|
||||
this.$store.commit("system/update_change_password_dialog",true)
|
||||
},
|
||||
logout () {
|
||||
window.one_logout('/one-ui/test/vuex/one-login')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
54
apps/components/oneNavbarComponentGlobal.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<span>
|
||||
<one-menu-drawer :drawer="drawer" > </one-menu-drawer>
|
||||
<v-toolbar color="blue lighten-2" dark fixed app>
|
||||
<v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-icon>
|
||||
<h1>ONE</h1>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<a href="#" style="text-decoration:none;color:#fff;font-size:22px; margin-right:15px">{{xusername}}</a>
|
||||
<v-badge color="red">
|
||||
<template v-slot:badge>
|
||||
<span>9</span>
|
||||
</template>
|
||||
<v-icon
|
||||
medium
|
||||
|
||||
>
|
||||
notifications
|
||||
</v-icon>
|
||||
</v-badge>
|
||||
<v-btn class="ml-4" icon>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
<style scoped>
|
||||
.v-badge__badge{
|
||||
top:-9px;
|
||||
right:-9px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-menu-drawer' : httpVueLoader('./oneMenuDrawerGlobal.vue')
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
drawer: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
xusername() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
un = dtuser.M_UserUsername
|
||||
}
|
||||
return un
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
168
apps/components/oneNavbarComponentNoMenu.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<span>
|
||||
<!--<one-menu-drawer :drawer="drawer" > </one-menu-drawer> -->
|
||||
<one-menu-notification :drawer="drawer_notification" > </one-menu-notification>
|
||||
<v-toolbar color="blue lighten-2" dark fixed app>
|
||||
<v-toolbar-side-icon @click.stop="togleDrawer()"></v-toolbar-side-icon>
|
||||
<h1>CPONE</h1>
|
||||
<h2 class="bread-crumb">{{bread_crumb}}</h2>
|
||||
<v-spacer></v-spacer>
|
||||
<a href="#" style="text-decoration:none;color:#fff;font-size:22px; margin-right:15px">{{ xusername }}</a>
|
||||
<v-badge color="red">
|
||||
<!--
|
||||
<template v-slot:badge>
|
||||
<span>9</span>
|
||||
</template>
|
||||
-->
|
||||
<v-btn icon @click.stop="drawer_notification = !drawer_notification" flat>
|
||||
<v-icon
|
||||
medium
|
||||
>
|
||||
notifications
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
</v-badge>
|
||||
|
||||
|
||||
<!-- <v-btn class="ml-4" icon>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn> -->
|
||||
|
||||
<!-- PROFILE MENU -->
|
||||
<v-menu
|
||||
:close-on-content-click="true"
|
||||
:nudge-width="200"
|
||||
offset-overflow
|
||||
left
|
||||
bottom
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
class="ml-4" icon
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-tile avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ xusername }}</v-list-tile-title>
|
||||
<v-list-tile-sub-title>{{xstaffname}}</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-list>
|
||||
<v-list-tile @click="change_password" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>security</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Change Password</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
<v-list>
|
||||
<v-list-tile @click="logout" >
|
||||
<v-list-tile-action>
|
||||
<v-icon>no_meeting_room</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Log Out</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-menu>
|
||||
<!-- End of PROFILE MENU -->
|
||||
|
||||
<one-cp></one-cp>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
<style scoped>
|
||||
.bread-crumb {
|
||||
margin-left:20px;
|
||||
font-weight:normal!important;
|
||||
}
|
||||
.v-badge__badge{
|
||||
top:0px;
|
||||
right:0px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-menu-drawer' : httpVueLoader('./oneMenuDrawer.vue'),
|
||||
'one-cp' : httpVueLoader('./oneChangePassword.vue'),
|
||||
'one-menu-notification' : httpVueLoader('./oneNotificationDrawer.vue')
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
drawer: false,
|
||||
drawer_notification: false
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
is_page_allowed : function(new_ipa, old_ipa) {
|
||||
if(! new_ipa ) {
|
||||
var dashboard = this.$store.state.system.dashboard
|
||||
if (dashboard == "") {
|
||||
//this.logout()
|
||||
console.log('go-to','logout')
|
||||
} else {
|
||||
//window.location.href = '/' + dashboard
|
||||
console.log('go-to dashboard',dashboard)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
is_page_allowed() {
|
||||
return this.$store.state.system.is_page_allowed
|
||||
},
|
||||
bread_crumb() {
|
||||
return this.$store.state.system.bread_crumb
|
||||
},
|
||||
xusername() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_UserUsername
|
||||
}
|
||||
return un
|
||||
},
|
||||
xstaffname() {
|
||||
var un = ''
|
||||
if(localStorage.getItem("user")){
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_StaffName
|
||||
}
|
||||
return un
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
togleDrawer() {
|
||||
window.location.href = "/one-ui/system/one-md-menu/"
|
||||
},
|
||||
change_password() {
|
||||
this.$store.commit("system/update_change_password_dialog",true)
|
||||
},
|
||||
logout () {
|
||||
window.one_logout('/one-ui/one-login')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
151
apps/components/oneNavbarComponent_auto.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<span>
|
||||
<one-menu-drawer :drawer="drawer"> </one-menu-drawer>
|
||||
<one-menu-notification :drawer="drawer_notification"> </one-menu-notification>
|
||||
<v-toolbar color="blue lighten-2" dark fixed app>
|
||||
<v-toolbar-side-icon class="hidden-sm-and-down" @click.stop="togleDrawer()"></v-toolbar-side-icon>
|
||||
<h1>ONE</h1>
|
||||
<h2 class="bread-crumb">{{ bread_crumb }}</h2>
|
||||
<v-spacer></v-spacer>
|
||||
<div style="margin-top:14px;margin-bottom:auto;">
|
||||
<span :class="auto_class" style='display:inline-block;margin-right:15px;font-size:16px;color:#ffffff;'>
|
||||
Auto Verifikasi
|
||||
</span>
|
||||
<v-switch v-model="flagAutoRun" style="margin-right:15px;display:inline-block;" color="#00ff00"></v-switch>
|
||||
<a href="#" style="text-decoration:none;color:#fff;font-size:22px; margin-right:15px">{{ xusername }}</a>
|
||||
|
||||
</div>
|
||||
<!-- PROFILE MENU -->
|
||||
<v-menu :close-on-content-click="true" :nudge-width="200" offset-overflow left bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn class="ml-4" icon v-on="on">
|
||||
<v-icon>apps</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-tile avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ xusername }}</v-list-tile-title>
|
||||
<v-list-tile-sub-title>{{ xstaffname }}</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-list>
|
||||
<v-list-tile @click="change_password">
|
||||
<v-list-tile-action>
|
||||
<v-icon>security</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Change Password</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
<v-list>
|
||||
<v-list-tile @click="logout">
|
||||
<v-list-tile-action>
|
||||
<v-icon>no_meeting_room</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>Log Out</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
|
||||
</v-list>
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-menu>
|
||||
<!-- End of PROFILE MENU -->
|
||||
|
||||
<one-cp></one-cp>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
<style scoped>
|
||||
.bread-crumb {
|
||||
margin-left: 20px;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
.v-badge__badge {
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-menu-drawer': httpVueLoader('./oneMenuDrawer.vue'),
|
||||
'one-cp': httpVueLoader('./oneChangePassword.vue'),
|
||||
'one-menu-notification': httpVueLoader('./oneNotificationDrawer.vue')
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
drawer: false,
|
||||
drawer_notification: false,
|
||||
flagAutoRun: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
is_page_allowed: function (new_ipa, old_ipa) {
|
||||
if (!new_ipa) {
|
||||
var dashboard = this.$store.state.system.dashboard
|
||||
if (dashboard == "") {
|
||||
//this.logout()
|
||||
console.log('go-to', 'logout')
|
||||
} else {
|
||||
//window.location.href = '/' + dashboard
|
||||
console.log('go-to dashboard', dashboard)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
is_page_allowed() {
|
||||
return this.$store.state.system.is_page_allowed
|
||||
},
|
||||
bread_crumb() {
|
||||
return this.$store.state.system.bread_crumb
|
||||
},
|
||||
xusername() {
|
||||
var un = ''
|
||||
if (localStorage.getItem("user")) {
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_UserUsername
|
||||
}
|
||||
return un
|
||||
},
|
||||
xstaffname() {
|
||||
var un = ''
|
||||
if (localStorage.getItem("user")) {
|
||||
var retrievedObject = localStorage.getItem('user')
|
||||
var dtuser = JSON.parse(retrievedObject)
|
||||
|
||||
un = dtuser.M_StaffName
|
||||
}
|
||||
return un
|
||||
},
|
||||
auto_label() {
|
||||
console.log('Auto', this.flagAutoRun);
|
||||
if (this.flagAutoRun) return 'Auto Verif Is Running';
|
||||
return 'Auto Verif Is Stopped';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
togleDrawer() {
|
||||
this.drawer = !this.drawer
|
||||
},
|
||||
change_password() {
|
||||
this.$store.commit("system/update_change_password_dialog", true)
|
||||
},
|
||||
logout() {
|
||||
window.one_logout('/one-ui/test/vuex/one-login-v2')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
138
apps/components/oneNotificationDrawer.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<v-navigation-drawer v-model="xdrawer" fixed app right temporary :width="drawerHeight">
|
||||
|
||||
<v-list two-line>
|
||||
<template v-for="(item, index) in items">
|
||||
<v-subheader
|
||||
v-bind:key="item.id"
|
||||
v-if="item.header"
|
||||
>
|
||||
{{ item.header }}
|
||||
</v-subheader>
|
||||
|
||||
|
||||
|
||||
<template v-for="(itm, idx) in item.items">
|
||||
<v-list-tile
|
||||
:key="itm.id"
|
||||
avatar
|
||||
>
|
||||
<v-list-tile-avatar>
|
||||
<img :src="itm.avatar">
|
||||
</v-list-tile-avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="itm.title"></v-list-tile-title>
|
||||
|
||||
<v-list-tile-sub-title v-html="itm.subtitle"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
|
||||
<v-list-tile-action v-if="itm.date">
|
||||
|
||||
{{ itm.date }}
|
||||
|
||||
</v-list-tile-action>
|
||||
|
||||
|
||||
</v-list-tile>
|
||||
<v-divider
|
||||
:key="itm.id+50000"
|
||||
:inset="true"
|
||||
></v-divider>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</v-list>
|
||||
|
||||
</v-navigation-drawer>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
items:
|
||||
[
|
||||
{
|
||||
// header: 'Today' ,
|
||||
items : [
|
||||
{
|
||||
avatar: 'https://cdn.vuetifyjs.com/images/lists/1.jpg',
|
||||
title: 'Brunch this weekend?',
|
||||
subtitle: "<span class='text--primary'>Ali Connors</span> — I'll be in your neighborhood doing errands this weekend. Do you want to hang out?",
|
||||
date: '15 mins'
|
||||
,id : 0
|
||||
},
|
||||
|
||||
{
|
||||
avatar: 'https://cdn.vuetifyjs.com/images/lists/2.jpg',
|
||||
title: 'Summer BBQ <span class="grey--text text--lighten-1">4</span>',
|
||||
subtitle: "<span class='text--primary'>to Alex, Scott, Jennifer</span> — Wish I could come, but I'm out of town this weekend.",
|
||||
date: '30 mins'
|
||||
,id : 1
|
||||
},
|
||||
|
||||
{
|
||||
avatar: 'https://cdn.vuetifyjs.com/images/lists/3.jpg',
|
||||
title: 'Oui oui',
|
||||
subtitle: "<span class='text--primary'>Sandra Adams</span> — Do you have Paris recommendations? Have you ever been?",
|
||||
date: '45 mins'
|
||||
,id : 2
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
// header: 'Yesterday' ,
|
||||
items : [
|
||||
{
|
||||
avatar: 'https://cdn.vuetifyjs.com/images/lists/1.jpg',
|
||||
title: 'Brunch this weekend?',
|
||||
subtitle: "<span class='text--primary'>Ali Connors</span> — I'll be in your neighborhood doing errands this weekend. Do you want to hang out?",
|
||||
date: '1 day'
|
||||
,id : 3
|
||||
},
|
||||
|
||||
{
|
||||
avatar: 'https://cdn.vuetifyjs.com/images/lists/2.jpg',
|
||||
title: 'Summer BBQ <span class="grey--text text--lighten-1">4</span>',
|
||||
subtitle: "<span class='text--primary'>to Alex, Scott, Jennifer</span> — Wish I could come, but I'm out of town this weekend.",
|
||||
date: '2 day'
|
||||
,id : 4
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
drawer: Boolean
|
||||
},
|
||||
|
||||
computed : {
|
||||
drawerHeight() {
|
||||
if (this.$vuetify.breakpoint.smAndDown) {
|
||||
return "300px"
|
||||
}
|
||||
return "500px"
|
||||
},
|
||||
xdrawer: {
|
||||
get() {
|
||||
return this.drawer
|
||||
},
|
||||
set(v) {
|
||||
this.$emit("togleDrawer")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
|
||||
},
|
||||
|
||||
methods : {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
62
apps/components/oneTanggal-bkp.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<div class="tanggal">
|
||||
{{f_tanggal}}
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
div.tanggal {
|
||||
text-decoration: none;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 14px;
|
||||
display:inline-block;
|
||||
margin-left:10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
let hari = ['Minggu','Senin','Selasa', 'Rabu', 'Kamis',"Jum'at","Sabtu"]
|
||||
let bulan = ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"]
|
||||
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
tanggal: new Date()
|
||||
,timepool : 0
|
||||
}
|
||||
}
|
||||
,computed: {
|
||||
f_tanggal() {
|
||||
try {
|
||||
let tgl = this.tanggal.getDate()
|
||||
let bln = bulan[this.tanggal.getMonth()]
|
||||
let day = hari[this.tanggal.getDay()]
|
||||
let result = day + ', ' + tgl + ' ' + bln + ' ' + this.tanggal.getFullYear()
|
||||
let hour = this.tanggal.getHours()
|
||||
let minute = this.tanggal.getMinutes()
|
||||
let second = this.tanggal.getSeconds()
|
||||
let jam = ' '
|
||||
if ( hour < 10 ) jam = jam + '0'
|
||||
jam = jam + hour.toString() + ':'
|
||||
if ( minute < 10 ) jam = jam + '0'
|
||||
jam = jam + minute.toString() + ':'
|
||||
if ( second< 10 ) jam = jam + + '0'
|
||||
jam = jam + second.toString()
|
||||
|
||||
result = result + ' ' + jam
|
||||
return result
|
||||
} catch(e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
, mounted() {
|
||||
let self = this
|
||||
this.timepool = setInterval(function() {
|
||||
self.tanggal = new Date()
|
||||
},1000)
|
||||
}
|
||||
,beforeDestroy() {
|
||||
if (this.timepool > 0 ) clearInterval(this.timepool)
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
70
apps/components/oneTanggal-new.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="tanggal">
|
||||
{{f_tanggal}}
|
||||
<span style="color:brown; margin-left:20px;font-weight:bold;font-size:16px;">
|
||||
{{branch_name}}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
div.tanggal {
|
||||
text-decoration: none;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 14px;
|
||||
display:inline-block;
|
||||
margin-left:10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
let hari = ['Minggu','Senin','Selasa', 'Rabu', 'Kamis',"Jum'at","Sabtu"]
|
||||
let bulan = ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"]
|
||||
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
tanggal: new Date()
|
||||
,timepool : 0
|
||||
}
|
||||
}
|
||||
,computed: {
|
||||
branch_name() {
|
||||
let branch = this.$store.state.system.branch
|
||||
if (branch.M_BranchName == undefined) return ''
|
||||
return branch.M_BranchName + ', ' + branch.M_BranchAddress
|
||||
},
|
||||
f_tanggal() {
|
||||
try {
|
||||
let tgl = this.tanggal.getDate()
|
||||
let bln = bulan[this.tanggal.getMonth()]
|
||||
let day = hari[this.tanggal.getDay()]
|
||||
let result = day + ', ' + tgl + ' ' + bln + ' ' + this.tanggal.getFullYear()
|
||||
let hour = this.tanggal.getHours()
|
||||
let minute = this.tanggal.getMinutes()
|
||||
let second = this.tanggal.getSeconds()
|
||||
let jam = ' '
|
||||
if ( hour < 10 ) jam = jam + '0'
|
||||
jam = jam + hour.toString() + ':'
|
||||
if ( minute < 10 ) jam = jam + '0'
|
||||
jam = jam + minute.toString() + ':'
|
||||
if ( second< 10 ) jam = jam + + '0'
|
||||
jam = jam + second.toString()
|
||||
|
||||
result = result + ' ' + jam
|
||||
return result
|
||||
} catch(e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
, mounted() {
|
||||
let self = this
|
||||
this.timepool = setInterval(function() {
|
||||
self.tanggal = new Date()
|
||||
},1000)
|
||||
}
|
||||
,beforeDestroy() {
|
||||
if (this.timepool > 0 ) clearInterval(this.timepool)
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
74
apps/components/oneTanggal.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div class="tanggal">
|
||||
{{f_tanggal}}
|
||||
<span class="hidden-sm-and-down" style="color:brown; margin-left:20px;font-weight:bold;font-size:16px;">
|
||||
{{branch_name}}
|
||||
</span>
|
||||
<div class="visible-sm-and-down hidden-md-and-up" style="color:brown; font-weight:bold;font-size:10px;">
|
||||
Devone <!-- {{branch_name}} -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
div.tanggal {
|
||||
text-decoration: none;
|
||||
vertical-align:top;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 14px;
|
||||
display:inline-block;
|
||||
margin-left:10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
let hari = ['Minggu','Senin','Selasa', 'Rabu', 'Kamis',"Jum'at","Sabtu"]
|
||||
let bulan = ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"]
|
||||
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
tanggal: new Date()
|
||||
,timepool : 0
|
||||
}
|
||||
}
|
||||
,computed: {
|
||||
branch_name() {
|
||||
let branch = this.$store.state.system.branch
|
||||
if (branch.M_BranchName == undefined) return ''
|
||||
return branch.M_BranchName
|
||||
},
|
||||
f_tanggal() {
|
||||
try {
|
||||
let tgl = this.tanggal.getDate()
|
||||
let bln = bulan[this.tanggal.getMonth()]
|
||||
let day = hari[this.tanggal.getDay()]
|
||||
let result = day + ', ' + tgl + ' ' + bln + ' ' + this.tanggal.getFullYear()
|
||||
let hour = this.tanggal.getHours()
|
||||
let minute = this.tanggal.getMinutes()
|
||||
let second = this.tanggal.getSeconds()
|
||||
let jam = ' '
|
||||
if ( hour < 10 ) jam = jam + '0'
|
||||
jam = jam + hour.toString() + ':'
|
||||
if ( minute < 10 ) jam = jam + '0'
|
||||
jam = jam + minute.toString() + ':'
|
||||
if ( second< 10 ) jam = jam + + '0'
|
||||
jam = jam + second.toString()
|
||||
|
||||
result = result + ' ' + jam
|
||||
return result
|
||||
} catch(e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
, mounted() {
|
||||
let self = this
|
||||
this.timepool = setInterval(function() {
|
||||
self.tanggal = new Date()
|
||||
},1000)
|
||||
}
|
||||
,beforeDestroy() {
|
||||
if (this.timepool > 0 ) clearInterval(this.timepool)
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
70
apps/components/oneTanggal.vue-010320
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="tanggal">
|
||||
{{f_tanggal}}
|
||||
<span style="color:brown; margin-left:20px;font-weight:bold;font-size:16px;">
|
||||
{{branch_name}}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
div.tanggal {
|
||||
text-decoration: none;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 14px;
|
||||
display:inline-block;
|
||||
margin-left:10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
let hari = ['Minggu','Senin','Selasa', 'Rabu', 'Kamis',"Jum'at","Sabtu"]
|
||||
let bulan = ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"]
|
||||
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
tanggal: new Date()
|
||||
,timepool : 0
|
||||
}
|
||||
}
|
||||
,computed: {
|
||||
branch_name() {
|
||||
let branch = this.$store.state.system.branch
|
||||
if (branch.M_BranchName == undefined) return ''
|
||||
return branch.M_BranchName
|
||||
},
|
||||
f_tanggal() {
|
||||
try {
|
||||
let tgl = this.tanggal.getDate()
|
||||
let bln = bulan[this.tanggal.getMonth()]
|
||||
let day = hari[this.tanggal.getDay()]
|
||||
let result = day + ', ' + tgl + ' ' + bln + ' ' + this.tanggal.getFullYear()
|
||||
let hour = this.tanggal.getHours()
|
||||
let minute = this.tanggal.getMinutes()
|
||||
let second = this.tanggal.getSeconds()
|
||||
let jam = ' '
|
||||
if ( hour < 10 ) jam = jam + '0'
|
||||
jam = jam + hour.toString() + ':'
|
||||
if ( minute < 10 ) jam = jam + '0'
|
||||
jam = jam + minute.toString() + ':'
|
||||
if ( second< 10 ) jam = jam + + '0'
|
||||
jam = jam + second.toString()
|
||||
|
||||
result = result + ' ' + jam
|
||||
return result
|
||||
} catch(e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
, mounted() {
|
||||
let self = this
|
||||
this.timepool = setInterval(function() {
|
||||
self.tanggal = new Date()
|
||||
},1000)
|
||||
}
|
||||
,beforeDestroy() {
|
||||
if (this.timepool > 0 ) clearInterval(this.timepool)
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
BIN
apps/image/background.png
Normal file
|
After Width: | Height: | Size: 389 KiB |
BIN
apps/image/background2.png
Normal file
|
After Width: | Height: | Size: 358 KiB |
BIN
apps/image/imageputih.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
apps/image/info.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
apps/image/logo.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
apps/image/onetext.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
apps/image/pramitaback.jpg
Normal file
|
After Width: | Height: | Size: 909 KiB |
BIN
apps/image/welcome.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
51
apps/login/api.js
Normal file
@@ -0,0 +1,51 @@
|
||||
const URL_LOGIN =
|
||||
"/one-api/v1/system/auth/login";
|
||||
const URL_IS_LOGIN =
|
||||
"/one-api/v1/system/auth/isLogin";
|
||||
|
||||
const ONE_TOKEN = "oneTokenId";
|
||||
|
||||
export async function login(userName, userPassword) {
|
||||
try {
|
||||
var resp = await axios.post(URL_LOGIN, {
|
||||
userName: userName,
|
||||
userPassword: userPassword
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return { status: "ERR", message: resp.statusText };
|
||||
}
|
||||
let data = resp.data;
|
||||
//Hardcoded 1st
|
||||
data.nextPage = "/one-ui/apps/main/";
|
||||
return data;
|
||||
} catch (e) {
|
||||
return { status: "ERR", message: e.message };
|
||||
}
|
||||
}
|
||||
|
||||
export async function isLogin(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL_IS_LOGIN, {
|
||||
token: token
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return { status: "ERR", message: resp.statusText };
|
||||
}
|
||||
let data = resp.data;
|
||||
//Hardcoded 1st
|
||||
data.nextPage = "/one-ui/apps/main/";
|
||||
return data;
|
||||
} catch (e) {
|
||||
return { status: "ERR", message: e.message };
|
||||
}
|
||||
}
|
||||
|
||||
export function loadOneToken() {
|
||||
return localStorage.getItem(ONE_TOKEN);
|
||||
}
|
||||
export function saveOneToken(token) {
|
||||
localStorage.setItem(ONE_TOKEN, token);
|
||||
}
|
||||
export function removeOneToken() {
|
||||
localStorage.removeItem(ONE_TOKEN);
|
||||
}
|
||||
113
apps/login/index.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<!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>Login</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="inspire">
|
||||
<v-content>
|
||||
<v-container fluid fill-height>
|
||||
<v-layout align-center justify-center>
|
||||
<v-flex xs12 sm8 md4>
|
||||
<v-card class="elevation-12">
|
||||
<v-toolbar dark color="primary">
|
||||
<v-toolbar-title>One UI</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
</v-toolbar>
|
||||
<v-alert
|
||||
:value="isError"
|
||||
type="warning"
|
||||
>
|
||||
{{errorMessage}}
|
||||
</v-alert>
|
||||
<v-progress-circular
|
||||
indeterminate
|
||||
v-show="isLoading"
|
||||
>
|
||||
|
||||
</v-progress-circular>
|
||||
|
||||
<v-card-text>
|
||||
<v-form>
|
||||
<v-text-field v-model="userName" prepend-icon="person" label="Login" type="text"></v-text-field>
|
||||
<v-text-field @keydown.enter="doLogin" v-model="userPassword" prepend-icon="lock" label="Password" type="password"></v-text-field>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="doLogin" color="primary">Login</v-btn>
|
||||
</v-card-actions>
|
||||
{{afterLogin}}
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
</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>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//window.store = store;
|
||||
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
data: {
|
||||
userName: "",
|
||||
userPassword: ""
|
||||
},
|
||||
methods : {
|
||||
doLogin() {
|
||||
this.$store.dispatch("login",{
|
||||
"userName": this.userName,
|
||||
"userPassword": this.userPassword
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...Vuex.mapState({
|
||||
errorMessage: state => state.errorMessage,
|
||||
isLoading: state => state.isLoading,
|
||||
isLogin: state => state.isLogin,
|
||||
nextPage: state => state.nextPage
|
||||
}),
|
||||
isError: function() {
|
||||
return this.errorMessage != "";
|
||||
},
|
||||
afterLogin: function() {
|
||||
if (this.isLogin) {
|
||||
document.location.href = this.nextPage;
|
||||
};
|
||||
}
|
||||
},
|
||||
created: function(){
|
||||
this.$store.dispatch("loadToken");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
61
apps/login/store.js
Normal file
@@ -0,0 +1,61 @@
|
||||
//import dari api
|
||||
import * as api from "./api.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
state: {
|
||||
isLogin: false,
|
||||
token: "",
|
||||
isLoading: false,
|
||||
errorMessage: "",
|
||||
nextPage: ""
|
||||
},
|
||||
mutations: {
|
||||
updateLoading(state, flag) {
|
||||
state.isLoading = flag;
|
||||
},
|
||||
updateIsLogin(state, flag) {
|
||||
state.isLogin = flag;
|
||||
},
|
||||
updateToken(state, resp) {
|
||||
state.token = resp.data.token;
|
||||
state.nextPage = resp.nextPage;
|
||||
},
|
||||
updateErrorMessage(state, msg) {
|
||||
state.errorMessage = msg;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async login(context, data) {
|
||||
context.commit("updateLoading", true);
|
||||
let resp = await api.login(data.userName, data.userPassword);
|
||||
if (resp.status == "OK") {
|
||||
context.commit("updateIsLogin", true);
|
||||
api.saveOneToken(resp.data.token);
|
||||
context.commit("updateToken", resp);
|
||||
context.commit("updateErrorMessage", "");
|
||||
} else {
|
||||
context.commit("updateIsLogin", false);
|
||||
context.commit("updateErrorMessage", resp.message);
|
||||
api.removeOneToken();
|
||||
setTimeout(() => {
|
||||
context.commit("updateErrorMessage", "");
|
||||
}, 3000);
|
||||
}
|
||||
context.commit("updateLoading", false);
|
||||
},
|
||||
async loadToken(context) {
|
||||
context.commit("updateLoading", true);
|
||||
let token = api.loadOneToken();
|
||||
if (token == "") {
|
||||
context.commit("updateIsLogin", false);
|
||||
} else {
|
||||
let resp = await api.isLogin(token);
|
||||
if (resp.status == "OK") {
|
||||
context.commit("updateToken", resp);
|
||||
context.commit("updateIsLogin", true);
|
||||
}
|
||||
}
|
||||
context.commit("updateLoading", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
0
apps/main/api.js
Normal file
108
apps/main/components/smartNavbarComponent.js
Normal file
@@ -0,0 +1,108 @@
|
||||
var smartNavbarComponent = {
|
||||
template: `
|
||||
<span>
|
||||
<v-navigation-drawer v-model="drawer" fixed app>
|
||||
<v-list>
|
||||
<v-list-group no-action group="l1home">
|
||||
<v-list-tile slot="activator">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
L1 Home
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>restaurant</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
Sub of Home
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group no-action sub-group group="l2home" >
|
||||
<v-list-tile slot="activator">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
L2 Home
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>restaurant</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
Sub of L2 Home
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group no-action sub-group group="l2home.l3home" >
|
||||
<v-list-tile slot="activator">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
L3 Home
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>restaurant</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
Sub of L3 Home
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-list-group>
|
||||
|
||||
</v-list-group>
|
||||
|
||||
</v-list-group>
|
||||
|
||||
<v-list-group no-action >
|
||||
<v-list-tile slot="activator">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
L1 School
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-tile>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
Sub of School
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
<v-list-tile-action>
|
||||
<v-icon>school</v-icon>
|
||||
</v-list-tile-action>
|
||||
</v-list-tile>
|
||||
</v-list-group>
|
||||
|
||||
|
||||
|
||||
</v-list>
|
||||
</v-navigation-drawer>
|
||||
<v-toolbar color="indigo" dark fixed app>
|
||||
<v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-icon>
|
||||
<v-toolbar-title>Application</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
</span>
|
||||
`,
|
||||
data: function() {
|
||||
return {
|
||||
drawer: true
|
||||
};
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
|
||||
export { smartNavbarComponent };
|
||||
62
apps/main/index.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<!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::Main</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">
|
||||
<smart-navbar></smart-navbar>
|
||||
<v-content>
|
||||
<v-container fluid fill-height style="height:inherit">
|
||||
<v-flex size="xs12">
|
||||
Welcome to ONE
|
||||
</v-flex>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<v-footer color="indigo" app>
|
||||
<span class="white--text">© 2017</span>
|
||||
</v-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>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { smartNavbarComponent } from './components/smartNavbarComponent.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
// window.store = store;
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
'smart-navbar': smartNavbarComponent
|
||||
},
|
||||
data: {
|
||||
drawer: false,
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
0
apps/main/store.js
Normal file
101
apps/modules/system/menu.js
Normal file
@@ -0,0 +1,101 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as menu_api from "../../api/system/menu.js?x=1"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search : '',
|
||||
search_status: 0,
|
||||
search_error_message: "",
|
||||
menu_level_0: [],
|
||||
menu_level_1: [],
|
||||
menu_level_2: [],
|
||||
total_menu: 0,
|
||||
//sipe add breadcrumb dan hak akses
|
||||
bread_crumb : "",
|
||||
is_page_allowed : true,
|
||||
dashboard:""
|
||||
},
|
||||
|
||||
mutations: {
|
||||
update_bread_crumb(state,val) {
|
||||
state.bread_crumb= val
|
||||
},
|
||||
update_dashboard(state,val) {
|
||||
state.dashboard= val
|
||||
},
|
||||
update_is_page_allowed(state,val) {
|
||||
state.is_page_allowed = val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_menu_level_0 (state, data) {
|
||||
state.menu_level_0 = data
|
||||
},
|
||||
|
||||
update_menu_level_1 (state, data) {
|
||||
state.menu_level_1 = data
|
||||
},
|
||||
|
||||
update_menu_level_2 (state, data) {
|
||||
state.menu_level_2 = data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_menu(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await menu_api.get_menu()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
|
||||
let x = resp.data
|
||||
if (x[0])
|
||||
context.commit("update_menu_level_0", x[0]['p_0'])
|
||||
|
||||
if (x[1])
|
||||
context.commit("update_menu_level_1", x[1])
|
||||
|
||||
if (x[2])
|
||||
context.commit("update_menu_level_2", x[2])
|
||||
// let data = {
|
||||
// total : resp.data.total,
|
||||
// records : resp.data.records
|
||||
// }
|
||||
|
||||
// context.commit("update_status", data)
|
||||
}
|
||||
//sipe :
|
||||
// tambahan get bread_crumb
|
||||
resp = await menu_api.get_bread_crumb()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
context.commit("update_bread_crumb",resp.data.bread_crumb)
|
||||
context.commit("update_page_allowed",resp.data.is_page_allowed)
|
||||
context.commit("update_dashboard",resp.data.dashboard)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
123
apps/modules/system/system-bkp.js
Normal file
@@ -0,0 +1,123 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as menu_api from "../../api/system/menu.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search : '',
|
||||
search_status: 0,
|
||||
search_error_message: "",
|
||||
menu_level_0: [],
|
||||
menu_level_1: [],
|
||||
menu_level_2: [],
|
||||
total_menu: 0,
|
||||
//sipe add breadcrumb dan hak akses
|
||||
bread_crumb : "",
|
||||
is_page_allowed : true,
|
||||
dashboard: "",
|
||||
//tambahan jumlah notification
|
||||
notification_count: 0,
|
||||
change_password_dialog: false,
|
||||
change_password_error: ""
|
||||
},
|
||||
|
||||
mutations: {
|
||||
update_change_password_dialog(state,val) {
|
||||
state.change_password_dialog = val
|
||||
},
|
||||
update_change_password_error(state,val) {
|
||||
state.change_password_error= val
|
||||
},
|
||||
update_bread_crumb(state,val) {
|
||||
state.bread_crumb = val
|
||||
},
|
||||
update_dashboard(state,val) {
|
||||
state.dashboard= val
|
||||
},
|
||||
update_page_allowed(state,val) {
|
||||
state.is_page_allowed = val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_menu_level_0 (state, data) {
|
||||
state.menu_level_0 = data
|
||||
},
|
||||
|
||||
update_menu_level_1 (state, data) {
|
||||
state.menu_level_1 = data
|
||||
},
|
||||
|
||||
update_menu_level_2 (state, data) {
|
||||
state.menu_level_2 = data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_menu(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await menu_api.get_menu(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
|
||||
let x = resp.data
|
||||
if (x[0])
|
||||
context.commit("update_menu_level_0", x[0]['p_0'])
|
||||
|
||||
if (x[1])
|
||||
context.commit("update_menu_level_1", x[1])
|
||||
|
||||
if (x[2])
|
||||
context.commit("update_menu_level_2", x[2])
|
||||
// let data = {
|
||||
// total : resp.data.total,
|
||||
// records : resp.data.records
|
||||
// }
|
||||
|
||||
// context.commit("update_status", data)
|
||||
}
|
||||
//sipe :
|
||||
// tambahan get bread_crumb
|
||||
resp = await menu_api.get_bread_crumb(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
context.commit("update_bread_crumb",resp.data.bread_crumb)
|
||||
context.commit("update_page_allowed",resp.data.is_page_allowed)
|
||||
context.commit("update_dashboard",resp.data.dashboard)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
async change_password(context,prm) {
|
||||
try {
|
||||
let resp = await menu_api.change_password(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_change_password_error",resp.message)
|
||||
} else {
|
||||
context.commit("update_change_password_error","")
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
122
apps/modules/system/system-new.js
Normal file
@@ -0,0 +1,122 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as menu_api from "../../api/system/menu.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search : '',
|
||||
search_status: 0,
|
||||
search_error_message: "",
|
||||
menu_level_0: [],
|
||||
menu_level_1: [],
|
||||
menu_level_2: [],
|
||||
total_menu: 0,
|
||||
//sipe add breadcrumb dan hak akses
|
||||
bread_crumb : "",
|
||||
is_page_allowed : true,
|
||||
dashboard: "",
|
||||
//tambahan jumlah notification
|
||||
notification_count: 0,
|
||||
change_password_dialog: false,
|
||||
change_password_error: "",
|
||||
branch: {}
|
||||
},
|
||||
|
||||
mutations: {
|
||||
update_branch(state,val) {
|
||||
state.branch = val
|
||||
},
|
||||
update_change_password_dialog(state,val) {
|
||||
state.change_password_dialog = val
|
||||
},
|
||||
update_change_password_error(state,val) {
|
||||
state.change_password_error= val
|
||||
},
|
||||
update_bread_crumb(state,val) {
|
||||
state.bread_crumb = val
|
||||
},
|
||||
update_dashboard(state,val) {
|
||||
state.dashboard= val
|
||||
},
|
||||
update_page_allowed(state,val) {
|
||||
state.is_page_allowed = val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_menu_level_0 (state, data) {
|
||||
state.menu_level_0 = data
|
||||
},
|
||||
|
||||
update_menu_level_1 (state, data) {
|
||||
state.menu_level_1 = data
|
||||
},
|
||||
|
||||
update_menu_level_2 (state, data) {
|
||||
state.menu_level_2 = data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_menu(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await menu_api.get_menu(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
|
||||
let x = resp.data
|
||||
if (x[0])
|
||||
context.commit("update_menu_level_0", x[0]['p_0'])
|
||||
|
||||
if (x[1])
|
||||
context.commit("update_menu_level_1", x[1])
|
||||
|
||||
if (x[2])
|
||||
context.commit("update_menu_level_2", x[2])
|
||||
}
|
||||
//sipe :
|
||||
// tambahan get bread_crumb
|
||||
resp = await menu_api.get_bread_crumb(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
context.commit("update_bread_crumb",resp.data.bread_crumb)
|
||||
context.commit("update_branch",resp.data.branch)
|
||||
context.commit("update_page_allowed",resp.data.is_page_allowed)
|
||||
context.commit("update_dashboard",resp.data.dashboard)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
async change_password(context,prm) {
|
||||
try {
|
||||
let resp = await menu_api.change_password(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_change_password_error",resp.message)
|
||||
} else {
|
||||
context.commit("update_change_password_error","")
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
122
apps/modules/system/system.js
Normal file
@@ -0,0 +1,122 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as menu_api from "../../api/system/menu.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search : '',
|
||||
search_status: 0,
|
||||
search_error_message: "",
|
||||
menu_level_0: [],
|
||||
menu_level_1: [],
|
||||
menu_level_2: [],
|
||||
total_menu: 0,
|
||||
//sipe add breadcrumb dan hak akses
|
||||
bread_crumb : "",
|
||||
is_page_allowed : true,
|
||||
dashboard: "",
|
||||
//tambahan jumlah notification
|
||||
notification_count: 0,
|
||||
change_password_dialog: false,
|
||||
change_password_error: "",
|
||||
branch: {}
|
||||
},
|
||||
|
||||
mutations: {
|
||||
update_branch(state,val) {
|
||||
state.branch = val
|
||||
},
|
||||
update_change_password_dialog(state,val) {
|
||||
state.change_password_dialog = val
|
||||
},
|
||||
update_change_password_error(state,val) {
|
||||
state.change_password_error= val
|
||||
},
|
||||
update_bread_crumb(state,val) {
|
||||
state.bread_crumb = val
|
||||
},
|
||||
update_dashboard(state,val) {
|
||||
state.dashboard= val
|
||||
},
|
||||
update_page_allowed(state,val) {
|
||||
state.is_page_allowed = val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_menu_level_0 (state, data) {
|
||||
state.menu_level_0 = data
|
||||
},
|
||||
|
||||
update_menu_level_1 (state, data) {
|
||||
state.menu_level_1 = data
|
||||
},
|
||||
|
||||
update_menu_level_2 (state, data) {
|
||||
state.menu_level_2 = data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_menu(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await menu_api.get_menu(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
|
||||
let x = resp.data
|
||||
if (x[0])
|
||||
context.commit("update_menu_level_0", x[0]['p_0'])
|
||||
|
||||
if (x[1])
|
||||
context.commit("update_menu_level_1", x[1])
|
||||
|
||||
if (x[2])
|
||||
context.commit("update_menu_level_2", x[2])
|
||||
}
|
||||
//sipe :
|
||||
// tambahan get bread_crumb
|
||||
resp = await menu_api.get_bread_crumb(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
context.commit("update_bread_crumb",resp.data.bread_crumb)
|
||||
context.commit("update_branch",resp.data.branch)
|
||||
context.commit("update_page_allowed",resp.data.is_page_allowed)
|
||||
context.commit("update_dashboard",resp.data.dashboard)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
async change_password(context,prm) {
|
||||
try {
|
||||
let resp = await menu_api.change_password(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_change_password_error",resp.message)
|
||||
} else {
|
||||
context.commit("update_change_password_error","")
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||