fix: Global component

backend^2
saeid 4 years ago
commit a76fe399c8

@ -1,16 +1,21 @@
<template>
<button :disabled="disabled" @click="$emit('click')" :type="type" :class="`slide-button ${theme}`">
<div class="overlay"></div>
<div v-if="prepend_icon != ''" class="prepend-icon">
<v-icon>WMi-{{ prepend_icon }}</v-icon>
</div>
<div class="name">
<div class="Fa"> {{ title_fa }} </div>
<div class="En"> {{ title_en }} </div>
</div>
<div v-if="append_icon" class="append-icon">
<v-icon>WMi-{{ append_icon }}</v-icon>
</div>
<button :disabled="disabled || loading" @click="$emit('click')" :type="type" :class="`slide-button ${theme}`">
<template>
<div class="overlay"></div>
<div v-if="prepend_icon != ''" class="prepend-icon">
<v-icon v-if="!loading" >WMi-{{ prepend_icon }}</v-icon>
<div v-else class="v-progress-circular v-progress-circular--indeterminate" style="height: 30px; width: 30px;">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="21.904761904761905 21.904761904761905 43.80952380952381 43.80952380952381" style="transform: rotate(0deg);"><circle fill="transparent" color= #fff cx="43.80952380952381" cy="43.80952380952381" r="20" stroke-width="3.8095238095238093" stroke-dasharray="125.664" stroke-dashoffset="125.66370614359172px" class="v-progress-circular__overlay"></circle></svg>
</div>
</div>
<div class="name">
<div class="Fa"> {{ title_fa }} </div>
<div class="En"> {{ title_en }} </div>
</div>
<div v-if="append_icon" class="append-icon">
<v-icon>WMi-{{ append_icon }}</v-icon>
</div>
</template>
</button>
</template>
<script>
@ -22,6 +27,7 @@ export default {
title_fa: {default: 'عنوان دکمه'},
title_en: {default: 'Button Title'},
disabled: {default: false},
loading: {default: false},
type: {default: 'button'},
},
}

@ -14,7 +14,7 @@
:dark="dark"
:light="light"
v-on="on"
@click="$emit('click', $event)"
@click.stop="$emit('click', $event)"
:small="small"
:large="large"
:x-large="xLarge"
@ -47,6 +47,10 @@ export default {
type: String,
default: "متن پیش فرض",
},
type: {
type: String,
default: "button",
},
tooltipColor: {
type: String,
default: "black",
@ -110,6 +114,3 @@ export default {
},
};
</script>
<style>
</style>

@ -39,6 +39,7 @@ function errorResponseHandler(error) {
return Promise.reject(error);
}
}
return Promise.reject(error.response);
}
function successHandler(response) {
if(response.status === 200 || response.status === 201) {

@ -94,5 +94,66 @@ const VirtualActivityService = {
localStorage.removeItem(PERMISSION)
},
}
const Paginate = {
export { TokenService, UserService, PermissionService, VirtualActivityService, CategoryNameService }
get(SERVICE) {
if (localStorage.getItem(SERVICE)) {
let service = qs.parse(localStorage.getItem(SERVICE), { strictNullHandling: true });
if (typeof service.pagination !== 'undefined' && service.pagination) {
let pagination = {};
for(let key in service.pagination) {
pagination[key] = Number(service.pagination[key])
}
return pagination
}
}
return null;
},
save(SERVICE, pagination = null ) {
let service = null;
if (localStorage.getItem(SERVICE)) {
service = qs.parse(localStorage.getItem(SERVICE));
} else {
service = {};
}
service['pagination'] = pagination;
let service_paginate = qs.stringify(service);
localStorage.setItem(SERVICE, service_paginate)
},
remove(SERVICE) {
this.save(SERVICE);
},
};
const Sort = {
get(SERVICE) {
if (localStorage.getItem(SERVICE)) {
let service = qs.parse(localStorage.getItem(SERVICE), { strictNullHandling: true });
if (typeof service.sort !== 'undefined' && service.sort) {
return service.sort
}
}
return null;
},
save(SERVICE, sort = '') {
let service = null;
if (localStorage.getItem(SERVICE)) {
service = qs.parse(localStorage.getItem(SERVICE));
} else {
service = {};
}
service['sort'] = sort;
let service_sort = qs.stringify(service);
localStorage.setItem(SERVICE, service_sort)
},
remove(SERVICE) {
this.save(SERVICE);
},
};
export { TokenService, UserService, PermissionService, VirtualActivityService, CategoryNameService, Paginate, Sort }

Loading…
Cancel
Save