transfer project in github
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<CSubheader
|
||||
class="custom-subheader px-3"
|
||||
:class="[
|
||||
sidebarShow ? null : 'sideBarClose',
|
||||
sidebarMinimize ? 'sideBarMinimized' : 'sideBarFull'
|
||||
]">
|
||||
<slot/>
|
||||
</CSubheader>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
computed: {
|
||||
sidebarShow() {
|
||||
return this.$store.state.admin.sidebarShow
|
||||
},
|
||||
sidebarMinimize() {
|
||||
return this.$store.state.admin.sidebarMinimize
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<CFooter :fixed="false">
|
||||
<div class="mfs-auto">
|
||||
<div class="copy-right">
|
||||
<span class="mr-1">Powered by</span>
|
||||
<a href="https://negarehagency.com/" target="_blank" class="company">Negareh Agency</a>
|
||||
</div>
|
||||
</div>
|
||||
</CFooter>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TheFooter'
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<CHeader fixed with-subheader light>
|
||||
<CToggler
|
||||
in-header
|
||||
class="ml-3 d-lg-none"
|
||||
@click="$store.commit('admin/toggleSidebarMobile')"
|
||||
/>
|
||||
<CToggler
|
||||
in-header
|
||||
class="ml-3 d-md-down-none"
|
||||
@click="$store.commit('admin/toggleSidebarDesktop')"
|
||||
/>
|
||||
<!-- <CHeaderNav class="">-->
|
||||
<!-- <CHeaderNavItem class="px-3">-->
|
||||
<!-- <Branches/>-->
|
||||
<!-- </CHeaderNavItem>-->
|
||||
<!-- </CHeaderNav>-->
|
||||
<CHeaderNav class="mr-4 mr-auto">
|
||||
<TheHeaderDropdownAccnt/>
|
||||
</CHeaderNav>
|
||||
</CHeader>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Branches from "./widgets/Branches.vue";
|
||||
|
||||
export default {
|
||||
name: 'TheHeader',
|
||||
components: {Branches},
|
||||
data() {
|
||||
return {
|
||||
breadcrumb: [
|
||||
{
|
||||
text: 'صفحه اصلی',
|
||||
to: '/admin'
|
||||
},
|
||||
{
|
||||
text: 'لیست دانلود ها',
|
||||
to: {name: 'admin-downloads'}
|
||||
},
|
||||
{
|
||||
text: 'This is a span'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
playSound() {
|
||||
const audio = new Audio(require('@/assets/admin/mp3/bell.mp3').default);
|
||||
audio.volume = 1.0;
|
||||
audio.play();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('load', function() {
|
||||
var audio = new Audio(require('@/assets/admin/mp3/bell.mp3').default);
|
||||
audio.muted = true
|
||||
audio.play();
|
||||
});
|
||||
|
||||
|
||||
const self = this
|
||||
const socket = io('/admin')
|
||||
// this.$axios.$get('/api/admin/pager')
|
||||
// .then(resp => {
|
||||
//
|
||||
// })
|
||||
|
||||
|
||||
socket.on('order', function (msg) {
|
||||
if (msg?.branchId === self.$route?.params?.branch){
|
||||
self.playSound()
|
||||
self.$notify({
|
||||
title: `سفارش جدید`,
|
||||
message: `یک سفارش جدید ثبت شد`,
|
||||
duration: 0,
|
||||
position: 'top-left'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<CDropdown
|
||||
inNav
|
||||
class="c-header-nav-items"
|
||||
placement="bottom-end"
|
||||
add-menu-classes="pt-0"
|
||||
>
|
||||
<template #toggler>
|
||||
<CHeaderNavLink>
|
||||
<div class="c-avatar">
|
||||
<img
|
||||
src="/img/avatars/avatar.png"
|
||||
class="c-avatar-img"
|
||||
alt=""
|
||||
title="حساب کاربری"
|
||||
/>
|
||||
</div>
|
||||
</CHeaderNavLink>
|
||||
</template>
|
||||
<CDropdownHeader tag="div" class="text-center" color="light">
|
||||
<strong v-if="$auth.loggedIn">{{ $auth.user.first_name }}</strong>
|
||||
</CDropdownHeader>
|
||||
|
||||
<!-- <CDropdownItem :to="{name: 'admin-users'}">-->
|
||||
<!-- <CIcon name="cil-user"/>-->
|
||||
<!-- <span>پروفایل</span>-->
|
||||
<!-- </CDropdownItem>-->
|
||||
|
||||
<CDropdownItem @click="logOut">
|
||||
<CIcon name="cil-lock-locked"/>
|
||||
<span>خروج از حساب</span>
|
||||
</CDropdownItem>
|
||||
</CDropdown>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TheHeaderDropdownAccnt',
|
||||
data() {
|
||||
return {
|
||||
itemsCount: 42
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
logOut() {
|
||||
this.$confirm('میخواهید از حساب کاربری خارج شوید؟', 'هشدار', {
|
||||
confirmButtonText: 'بله',
|
||||
cancelButtonText: 'لغو',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
try {
|
||||
await this.$auth.logout()
|
||||
window.location.replace('/admin/login')
|
||||
} catch (e) {
|
||||
console.log(e?.response?.data)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: 'عملیات لغو شد'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.c-icon{
|
||||
margin-right: 0.3rem;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<CSidebar
|
||||
fixed
|
||||
:minimize="minimize"
|
||||
:show="show"
|
||||
@update:show="(value) => $store.commit('admin/set', ['sidebarShow', value])"
|
||||
>
|
||||
<CSidebarBrand class="d-md-down-none">
|
||||
<a href="/" target="_blank">
|
||||
<IconsLogo class="c-sidebar-brand-full" name="logo" style="width: 100%"/>
|
||||
<img src="/favicon.png" alt="logo" class="c-sidebar-brand-minimized" size="custom-size" :height="35" name="logo">
|
||||
</a>
|
||||
</CSidebarBrand>
|
||||
|
||||
<!-- <CRenderFunction flat :content-to-render="$options.nav"/>-->
|
||||
|
||||
<!-- sidebar content -->
|
||||
<CSidebarNav v-if="!$route.name.includes('admin-branches') && $route.name.includes('admin-branch')">
|
||||
<CSidebarNavItem name="شعب" :to="{name: 'admin'}" font-icon="fal fa-code-branch"/>
|
||||
|
||||
<CSidebarNavItem name="صفحه اصلی" :to="{name: 'admin-branch'}" font-icon="fal fa-home"/>
|
||||
|
||||
<CSidebarNavItem v-if="hasPermission('users') || hasPermission('super-admin')" name="مدیریت کاربران"
|
||||
:to="{name: 'admin-branch-users'}" font-icon="fal fa-user-crown"/>
|
||||
|
||||
<CSidebarNavItem v-if="hasPermission('reports') || hasPermission('super-admin')" name="گزارشات" :to="{name:
|
||||
'admin-branch-reports'}" font-icon="fal fa-analytics"/>
|
||||
|
||||
<CSidebarNavItem v-if="hasPermission('orders') || hasPermission('super-admin')" name="مدیریت سفارشات"
|
||||
:to="{name: 'admin-branch-orders'}" font-icon="fal fa-cash-register"/>
|
||||
|
||||
|
||||
<CSidebarNavDropdown v-if="hasPermission('foods') || hasPermission('super-admin')" name="مدیریت محصولات" fontIcon="fal fa-utensils">
|
||||
<CSidebarNavItem name="انواع منوها" :to="{name: 'admin-branch-menu-types'}" :exact="false"/>
|
||||
<CSidebarNavItem name="دسته بندی محصولات" :to="{name: 'admin-branch-food-categories'}" :exact="false"/>
|
||||
<CSidebarNavItem name="لیست محصولات" :to="{name: 'admin-branch-foods'}" :exact="false"/>
|
||||
<CSidebarNavItem name="منوهای ویژه مهمانی" :to="{name: 'admin-branch-party-sets'}" :exact="false"/>
|
||||
</CSidebarNavDropdown>
|
||||
|
||||
<CSidebarNavDropdown v-if="hasPermission('super-admin')" name="مدیریت اپلیکیشن" fontIcon="fal fa-mobile-android">
|
||||
<CSidebarNavItem v-if="hasPermission('settings') || hasPermission('super-admin')" name="تنظیمات فروشگاه"
|
||||
:to="{name: 'admin-branch-storeInfo'}" :exact="false"/>
|
||||
<CSidebarNavItem v-if="hasPermission('notification') || hasPermission('super-admin')" name="نوتیفیکیشن"
|
||||
:to="{name: 'admin-branch-notification'}" :exact="false"/>
|
||||
<CSidebarNavItem v-if="hasPermission('settings') || hasPermission('super-admin')" name="مدیریت شغل ها"
|
||||
:to="{name: 'admin-branch-jobs'}" :exact="false"/>
|
||||
<CSidebarNavItem v-if="hasPermission('discounts') || hasPermission('super-admin')" name="کد های تخفیف"
|
||||
:to="{name: 'admin-branch-discounts'}" /><!--font-icon="fal fa-badge-percent"-->
|
||||
<CSidebarNavItem v-if="hasPermission('customers') || hasPermission('super-admin')" name="لیست مشتریان"
|
||||
:to="{name: 'admin-branch-customers'}"/><!--font-icon="fal fa-users"-->
|
||||
</CSidebarNavDropdown>
|
||||
|
||||
<!-- <CSidebarNavDropdown v-if="hasPermission('settings') || hasPermission('super-admin')" name="مدیریت وبسایت" fontIcon="fal fa-cog">-->
|
||||
<!-- <CSidebarNavItem name="اسلایدر" :to="{name: 'admin-slider'}" :exact="false"/>-->
|
||||
<!-- <CSidebarNavItem name="گالری تصاویر" :to="{name: 'admin-gallery'}" :exact="false"/>-->
|
||||
<!-- <CSidebarNavItem name="پیام های صفحه تماس با ما" :to="{name: 'admin-contact-us-messages'}" :badge="unreadMessages ? {text: unreadMessages,color:'danger'} : null" :exact="false"/>-->
|
||||
<!-- <CSidebarNavItem name="امور مشترکین" :to="{name: 'admin-subscribers'}" :exact="false"/>-->
|
||||
<!-- </CSidebarNavDropdown>-->
|
||||
|
||||
</CSidebarNav>
|
||||
|
||||
<CSidebarNav v-else>
|
||||
<!-- <CSidebarNavItem name="صفحه اصلی" :to="{name: 'admin'}" font-icon="fal fa-home"/>-->
|
||||
|
||||
<CSidebarNavItem name="شعب" :to="{name: 'admin'}" font-icon="fal fa-code-branch"/>
|
||||
|
||||
<CSidebarNavDropdown v-if="hasPermission('settings') || hasPermission('super-admin')" name="مدیریت وبسایت" fontIcon="fal fa-cog">
|
||||
<CSidebarNavItem name="اسلایدر" :to="{name: 'admin-slider'}" :exact="false"/>
|
||||
<CSidebarNavItem name="گالری تصاویر" :to="{name: 'admin-gallery'}" :exact="false"/>
|
||||
<CSidebarNavItem name="پیام های صفحه تماس با ما" :to="{name: 'admin-contact-us-messages'}" :badge="unreadMessages ? {text: unreadMessages,color:'danger'} : null" :exact="false"/>
|
||||
<CSidebarNavItem name="امور مشترکین" :to="{name: 'admin-subscribers'}" :exact="false"/>
|
||||
</CSidebarNavDropdown>
|
||||
</CSidebarNav>
|
||||
|
||||
<!-- sidebar content -->
|
||||
|
||||
<CSidebarMinimizer
|
||||
class="d-md-down-none"
|
||||
@click.native="$store.commit('admin/set', ['sidebarMinimize', !minimize])"
|
||||
/>
|
||||
</CSidebar>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import nav from './_nav'
|
||||
|
||||
export default {
|
||||
name: 'TheSidebar',
|
||||
// nav,
|
||||
computed: {
|
||||
show() {
|
||||
return this.$store.state.admin.sidebarShow
|
||||
},
|
||||
minimize() {
|
||||
return this.$store.state.admin.sidebarMinimize
|
||||
},
|
||||
unreadMessages() {
|
||||
return this.$store.state.admin.unreadMessagesCount
|
||||
},
|
||||
unreadTickets() {
|
||||
return this.$store.state.admin.unreadTicketsCount
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasPermission(permission) {
|
||||
if (this.$auth.loggedIn) return this.$auth.user.permissions.includes(permission)
|
||||
else return false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<CChartBar
|
||||
:datasets="defaultDatasets"
|
||||
labels="months"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CChartBarExample',
|
||||
computed: {
|
||||
defaultDatasets() {
|
||||
return [
|
||||
{
|
||||
label: 'GitHub Commits',
|
||||
backgroundColor: '#f87979',
|
||||
data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<CChartBar
|
||||
:datasets="computedDatasets"
|
||||
:options="computedOptions"
|
||||
:labels="labels"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CoreUtils from '~/mixins/CoreUtils'
|
||||
|
||||
export default {
|
||||
name: 'CChartBarSimple',
|
||||
mixins: [CoreUtils],
|
||||
props: {
|
||||
datasets: Array,
|
||||
labels: [Array, String],
|
||||
options: Object,
|
||||
plugins: Array,
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: 'rgba(0,0,0,.2)'
|
||||
},
|
||||
pointHoverBackgroundColor: String,
|
||||
dataPoints: {
|
||||
type: Array,
|
||||
default: () => [10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: 'Sales'
|
||||
},
|
||||
pointed: Boolean
|
||||
},
|
||||
computed: {
|
||||
defaultDatasets() {
|
||||
return [
|
||||
{
|
||||
data: this.dataPoints,
|
||||
backgroundColor: this.getColor(this.backgroundColor),
|
||||
pointHoverBackgroundColor: this.getColor(this.pointHoverBackgroundColor),
|
||||
label: this.label,
|
||||
barPercentage: 0.5,
|
||||
categoryPercentage: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
defaultOptions() {
|
||||
return {
|
||||
maintainAspectRatio: false,
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
display: false
|
||||
}],
|
||||
yAxes: [{
|
||||
display: false
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
computedDatasets() {
|
||||
return this.deepObjectsMerge(this.defaultDatasets, this.datasets || {})
|
||||
},
|
||||
computedOptions() {
|
||||
return this.deepObjectsMerge(this.defaultOptions, this.options || {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<CChartDoughnut
|
||||
:datasets="defaultDatasets"
|
||||
:labels="['VueJs', 'EmberJs', 'ReactJs', 'AngularJs']"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CChartDoughnutExample',
|
||||
computed: {
|
||||
defaultDatasets() {
|
||||
return [
|
||||
{
|
||||
backgroundColor: [
|
||||
'#41B883',
|
||||
'#E46651',
|
||||
'#00D8FF',
|
||||
'#DD1B16'
|
||||
],
|
||||
data: [40, 20, 80, 10]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<CChartLine
|
||||
:datasets="defaultDatasets"
|
||||
labels="months"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CChartLineExample',
|
||||
computed: {
|
||||
defaultDatasets() {
|
||||
return [
|
||||
{
|
||||
label: 'Data One',
|
||||
backgroundColor: 'rgb(228,102,81,0.9)',
|
||||
data: [30, 39, 10, 50, 30, 70, 35]
|
||||
},
|
||||
{
|
||||
label: 'Data Two',
|
||||
backgroundColor: 'rgb(0,216,255,0.9)',
|
||||
data: [39, 80, 40, 35, 40, 20, 45]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<CChartLine
|
||||
:datasets="computedDatasets"
|
||||
:options="computedOptions"
|
||||
:labels="labels"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CoreUtils from '~/mixins/CoreUtils'
|
||||
|
||||
export default {
|
||||
name: 'CChartLineSimple',
|
||||
mixins: [CoreUtils],
|
||||
props: {
|
||||
datasets: Array,
|
||||
labels: [Array, String],
|
||||
options: Object,
|
||||
plugins: Array,
|
||||
borderColor: {
|
||||
type: String,
|
||||
default: 'rgba(255,255,255,.55)'
|
||||
},
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: 'transparent'
|
||||
},
|
||||
dataPoints: {
|
||||
type: Array,
|
||||
default: () => [10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: 'Sales'
|
||||
},
|
||||
pointed: Boolean,
|
||||
pointHoverBackgroundColor: String
|
||||
},
|
||||
computed: {
|
||||
pointHoverColor() {
|
||||
if (this.pointHoverBackgroundColor) {
|
||||
return this.pointHoverBackgroundColor
|
||||
} else if (this.backgroundColor !== 'transparent') {
|
||||
return this.backgroundColor
|
||||
}
|
||||
return this.borderColor
|
||||
},
|
||||
defaultDatasets() {
|
||||
return [
|
||||
{
|
||||
data: this.dataPoints,
|
||||
borderColor: this.getColor(this.borderColor),
|
||||
backgroundColor: this.getColor(this.backgroundColor),
|
||||
pointBackgroundColor: this.getColor(this.pointHoverColor),
|
||||
pointHoverBackgroundColor: this.getColor(this.pointHoverColor),
|
||||
label: this.label
|
||||
}
|
||||
]
|
||||
},
|
||||
pointedOptions() {
|
||||
return {
|
||||
scales: {
|
||||
xAxes: [
|
||||
{
|
||||
offset: true,
|
||||
gridLines: {
|
||||
color: 'transparent',
|
||||
zeroLineColor: 'transparent'
|
||||
},
|
||||
ticks: {
|
||||
fontSize: 2,
|
||||
fontColor: 'transparent'
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxes: [
|
||||
{
|
||||
display: false,
|
||||
ticks: {
|
||||
display: false,
|
||||
min: Math.min.apply(Math, this.dataPoints) - 5,
|
||||
max: Math.max.apply(Math, this.dataPoints) + 5
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
borderWidth: 1
|
||||
},
|
||||
point: {
|
||||
radius: 4,
|
||||
hitRadius: 10,
|
||||
hoverRadius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
straightOptions() {
|
||||
return {
|
||||
scales: {
|
||||
xAxes: [{
|
||||
display: false
|
||||
}],
|
||||
yAxes: [{
|
||||
display: false
|
||||
}]
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
borderWidth: 2
|
||||
},
|
||||
point: {
|
||||
radius: 0,
|
||||
hitRadius: 10,
|
||||
hoverRadius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultOptions() {
|
||||
const options = this.pointed ? this.pointedOptions : this.straightOptions
|
||||
return Object.assign({}, options, {
|
||||
maintainAspectRatio: false,
|
||||
legend: {
|
||||
display: false
|
||||
}
|
||||
})
|
||||
},
|
||||
computedDatasets() {
|
||||
return this.deepObjectsMerge(this.defaultDatasets, this.datasets || {})
|
||||
},
|
||||
computedOptions() {
|
||||
return this.deepObjectsMerge(this.defaultOptions, this.options || {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<CChartPie
|
||||
:datasets="defaultDatasets"
|
||||
:labels="['VueJs', 'EmberJs', 'ReactJs', 'AngularJs']"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CChartPieExample',
|
||||
computed: {
|
||||
defaultDatasets () {
|
||||
return [
|
||||
{
|
||||
backgroundColor: [
|
||||
'#41B883',
|
||||
'#E46651',
|
||||
'#00D8FF',
|
||||
'#DD1B16'
|
||||
],
|
||||
data: [40, 20, 80, 10]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<CChartPolarArea
|
||||
:datasets="defaultDatasets"
|
||||
:options="defaultOptions"
|
||||
:labels="[
|
||||
'Eating', 'Drinking', 'Sleeping', 'Designing',
|
||||
'Coding', 'Cycling', 'Running'
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CChartPolarAreaExample',
|
||||
computed: {
|
||||
defaultDatasets () {
|
||||
return [
|
||||
{
|
||||
label: 'My First dataset',
|
||||
backgroundColor: 'rgba(179,181,198,0.2)',
|
||||
pointBackgroundColor: 'rgba(179,181,198,1)',
|
||||
pointBorderColor: '#fff',
|
||||
pointHoverBackgroundColor: 'rgba(179,181,198,1)',
|
||||
pointHoverBorderColor: 'rgba(179,181,198,1)',
|
||||
data: [65, 59, 90, 81, 56, 55, 40]
|
||||
},
|
||||
{
|
||||
label: 'My Second dataset',
|
||||
backgroundColor: 'rgba(255,99,132,0.2)',
|
||||
pointBackgroundColor: 'rgba(255,99,132,1)',
|
||||
pointBorderColor: '#fff',
|
||||
pointHoverBackgroundColor: 'rgba(255,99,132,1)',
|
||||
pointHoverBorderColor: 'rgba(255,99,132,1)',
|
||||
data: [28, 48, 40, 19, 96, 27, 100]
|
||||
}
|
||||
]
|
||||
},
|
||||
defaultOptions () {
|
||||
return {
|
||||
aspectRatio: 1.5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<CChartRadar
|
||||
:datasets="defaultDatasets"
|
||||
:options="defaultOptions"
|
||||
:labels="[
|
||||
'Eating', 'Drinking', 'Sleeping', 'Designing',
|
||||
'Coding', 'Cycling', 'Running'
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CChartRadarExample',
|
||||
computed: {
|
||||
defaultDatasets() {
|
||||
return [
|
||||
{
|
||||
label: '2019',
|
||||
backgroundColor: 'rgba(179,181,198,0.2)',
|
||||
borderColor: 'rgba(179,181,198,1)',
|
||||
pointBackgroundColor: 'rgba(179,181,198,1)',
|
||||
pointBorderColor: '#fff',
|
||||
pointHoverBackgroundColor: '#fff',
|
||||
pointHoverBorderColor: 'rgba(179,181,198,1)',
|
||||
tooltipLabelColor: 'rgba(179,181,198,1)',
|
||||
data: [65, 59, 90, 81, 56, 55, 40]
|
||||
},
|
||||
{
|
||||
label: '2020',
|
||||
backgroundColor: 'rgba(255,99,132,0.2)',
|
||||
borderColor: 'rgba(255,99,132,1)',
|
||||
pointBackgroundColor: 'rgba(255,99,132,1)',
|
||||
pointBorderColor: '#fff',
|
||||
pointHoverBackgroundColor: '#fff',
|
||||
pointHoverBorderColor: 'rgba(255,99,132,1)',
|
||||
tooltipLabelColor: 'rgba(255,99,132,1)',
|
||||
data: [28, 48, 40, 19, 96, 27, 100]
|
||||
}
|
||||
]
|
||||
},
|
||||
defaultOptions() {
|
||||
return {
|
||||
aspectRatio: 1.5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<CChartLine
|
||||
:datasets="defaultDatasets"
|
||||
:options="defaultOptions"
|
||||
:labels="['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { CChartLine } from '@coreui/vue-chartjs'
|
||||
// import { getStyle, hexToRgba } from '@coreui/utils/src'
|
||||
import CoreUtils from '~/mixins/CoreUtils'
|
||||
|
||||
function random(min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1) + min)
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'MainChartExample',
|
||||
mixins: [CoreUtils],
|
||||
computed: {
|
||||
defaultDatasets() {
|
||||
const brandSuccess = this.getStyle('success2') || '#4dbd74'
|
||||
const brandInfo = this.getStyle('info') || '#20a8d8'
|
||||
const brandDanger = this.getStyle('danger') || '#f86c6b'
|
||||
|
||||
let elements = 27
|
||||
const data1 = []
|
||||
const data2 = []
|
||||
const data3 = []
|
||||
|
||||
for (let i = 0; i <= elements; i++) {
|
||||
data1.push(random(50, 200))
|
||||
data2.push(random(80, 100))
|
||||
data3.push(65)
|
||||
}
|
||||
return [
|
||||
{
|
||||
label: 'My First dataset',
|
||||
backgroundColor: this.hexToRgba(brandInfo, 10),
|
||||
borderColor: brandInfo,
|
||||
pointHoverBackgroundColor: brandInfo,
|
||||
borderWidth: 2,
|
||||
data: data1
|
||||
},
|
||||
{
|
||||
label: 'My Second dataset',
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: brandSuccess,
|
||||
pointHoverBackgroundColor: brandSuccess,
|
||||
borderWidth: 2,
|
||||
data: data2
|
||||
},
|
||||
{
|
||||
label: 'My Third dataset',
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: brandDanger,
|
||||
pointHoverBackgroundColor: brandDanger,
|
||||
borderWidth: 1,
|
||||
borderDash: [8, 5],
|
||||
data: data3
|
||||
}
|
||||
]
|
||||
},
|
||||
defaultOptions() {
|
||||
return {
|
||||
|
||||
maintainAspectRatio: false,
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
gridLines: {
|
||||
drawOnChartArea: false
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
maxTicksLimit: 5,
|
||||
stepSize: Math.ceil(250 / 5),
|
||||
max: 250
|
||||
},
|
||||
gridLines: {
|
||||
display: true
|
||||
}
|
||||
}]
|
||||
},
|
||||
elements: {
|
||||
point: {
|
||||
radius: 0,
|
||||
hitRadius: 10,
|
||||
hoverRadius: 4,
|
||||
hoverBorderWidth: 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
layout: 'admin'
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<CRow>
|
||||
<CCol sm="12" class="err">
|
||||
<el-select v-model="branch" filterable style="width: 100%">
|
||||
<el-option v-for="item in branches" :key="item._id" :value="item._id" :label="item.title || 'شعبه اراک'"/>
|
||||
</el-select>
|
||||
</CCol>
|
||||
</CRow>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Branches",
|
||||
data () {
|
||||
return {
|
||||
branches: [],
|
||||
branch: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.branch = this.branches[0]._id
|
||||
},
|
||||
async fetch() {
|
||||
try {
|
||||
this.branches = await this.$axios.$get(`/api/admin/store/getAll`)
|
||||
this.branch = this.branches[0]._id
|
||||
this.$store.commit('admin/set' , ['branchId' , this.branch])
|
||||
} catch (e) {
|
||||
if (e?.response?.status === 401) {
|
||||
this.$nuxt.error({
|
||||
status: 401,
|
||||
message: "لطفا دوباره وارد سیستم شوید.",
|
||||
});
|
||||
}
|
||||
if (e?.response?.status === 403) {
|
||||
this.$nuxt.error({
|
||||
status: 403,
|
||||
message: e?.response?.data?.message,
|
||||
});
|
||||
}
|
||||
if (e?.response?.status === 500) {
|
||||
this.$nuxt.error({
|
||||
status: 500,
|
||||
message: "مشکلی در گرفتن اطلاعات پیش آمده",
|
||||
});
|
||||
} else
|
||||
this.$nuxt.error({
|
||||
status: 404,
|
||||
message: "اطلاعات مورد نظر پیدا نشد",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<CRow>
|
||||
<template v-if="!noCharts">
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
color="facebook"
|
||||
right-header="89k"
|
||||
right-footer="friends"
|
||||
left-header="459"
|
||||
left-footer="feeds"
|
||||
>
|
||||
<CIcon
|
||||
name="cib-facebook"
|
||||
height="52"
|
||||
class="my-4"
|
||||
/>
|
||||
<CChartLineSimple
|
||||
class="c-chart-brand"
|
||||
background-color="rgba(255,255,255,.1)"
|
||||
:data-points="[65, 59, 84, 84, 51, 55, 40]"
|
||||
label="Friends"
|
||||
labels="months"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
color="twitter"
|
||||
right-header="973k"
|
||||
right-footer="followers"
|
||||
left-header="1.792"
|
||||
left-footer="tweets"
|
||||
>
|
||||
<CIcon
|
||||
name="cib-twitter"
|
||||
height="52"
|
||||
class="my-4"
|
||||
/>
|
||||
<CChartLineSimple
|
||||
class="c-chart-brand"
|
||||
background-color="rgba(255,255,255,.1)"
|
||||
:data-points="[1, 13, 9, 17, 34, 41, 38]"
|
||||
label="Followers"
|
||||
labels="months"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
color="linkedin"
|
||||
right-header="500+"
|
||||
right-footer="contracts"
|
||||
left-header="292"
|
||||
left-footer="feeds"
|
||||
>
|
||||
<CIcon
|
||||
name="cib-linkedin"
|
||||
height="52"
|
||||
class="my-4"
|
||||
/>
|
||||
<CChartLineSimple
|
||||
class="c-chart-brand"
|
||||
background-color="rgba(255,255,255,.1)"
|
||||
:data-points="[78, 81, 80, 45, 34, 12, 40]"
|
||||
label="Contracts"
|
||||
labels="months"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
right-header="12"
|
||||
right-footer="events"
|
||||
left-header="4"
|
||||
left-footer="meetings"
|
||||
color="warning"
|
||||
>
|
||||
<CIcon
|
||||
name="cil-calendar"
|
||||
height="52"
|
||||
class="my-4"
|
||||
/>
|
||||
<CChartLineSimple
|
||||
class="c-chart-brand"
|
||||
background-color="rgba(255,255,255,.1)"
|
||||
:data-points="[35, 23, 56, 22, 97, 23, 64]"
|
||||
label="Followers"
|
||||
labels="months"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
</template>
|
||||
<template v-else>
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
color="facebook"
|
||||
right-header="89k"
|
||||
right-footer="friends"
|
||||
left-header="459"
|
||||
left-footer="feeds"
|
||||
>
|
||||
<CIcon
|
||||
name="cib-facebook"
|
||||
height="56"
|
||||
class="my-4"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
color="twitter"
|
||||
right-header="973k"
|
||||
right-footer="followers"
|
||||
left-header="1.792"
|
||||
left-footer="tweets"
|
||||
>
|
||||
<CIcon
|
||||
name="cib-twitter"
|
||||
height="56"
|
||||
class="my-4"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
color="linkedin"
|
||||
right-header="500+"
|
||||
right-footer="contracts"
|
||||
left-header="292"
|
||||
left-footer="feeds"
|
||||
>
|
||||
<CIcon
|
||||
name="cib-linkedin"
|
||||
height="56"
|
||||
class="my-4"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
<CCol md="3" sm="6">
|
||||
<CWidgetBrand
|
||||
right-header="12"
|
||||
right-footer="events"
|
||||
left-header="4"
|
||||
left-footer="meetings"
|
||||
color="warning"
|
||||
>
|
||||
<CIcon
|
||||
name="cil-calendar"
|
||||
height="56"
|
||||
class="my-4"
|
||||
/>
|
||||
</CWidgetBrand>
|
||||
</CCol>
|
||||
</template>
|
||||
</CRow>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'WidgetsBrand',
|
||||
props: {
|
||||
noCharts: Boolean
|
||||
},
|
||||
layout: 'admin'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.c-chart-brand {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<CRow>
|
||||
<CCol sm="6" lg="3">
|
||||
<CWidgetDropdown color="primary" header="9.823" text="Members online">
|
||||
<template #default>
|
||||
<CDropdown
|
||||
color="transparent p-0"
|
||||
placement="bottom-end"
|
||||
>
|
||||
<template #toggler-content>
|
||||
<CIcon name="cil-settings"/>
|
||||
</template>
|
||||
<CDropdownItem>Action</CDropdownItem>
|
||||
<CDropdownItem>Another action</CDropdownItem>
|
||||
<CDropdownItem>Something else here...</CDropdownItem>
|
||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||
</CDropdown>
|
||||
</template>
|
||||
<template #footer>
|
||||
<CChartLineSimple
|
||||
pointed
|
||||
class="mt-3 mx-3"
|
||||
style="height:70px"
|
||||
:data-points="[65, 59, 84, 84, 51, 55, 40]"
|
||||
point-hover-background-color="primary"
|
||||
label="Members"
|
||||
labels="months"
|
||||
/>
|
||||
</template>
|
||||
</CWidgetDropdown>
|
||||
</CCol>
|
||||
<CCol sm="6" lg="3">
|
||||
<CWidgetDropdown color="info" header="9.823" text="Members online">
|
||||
<template #default>
|
||||
<CDropdown
|
||||
color="transparent p-0"
|
||||
placement="bottom-end"
|
||||
:caret="false"
|
||||
>
|
||||
<template #toggler-content>
|
||||
<CIcon name="cil-location-pin"/>
|
||||
</template>
|
||||
<CDropdownItem>Action</CDropdownItem>
|
||||
<CDropdownItem>Another action</CDropdownItem>
|
||||
<CDropdownItem>Something else here...</CDropdownItem>
|
||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||
</CDropdown>
|
||||
</template>
|
||||
<template #footer>
|
||||
<CChartLineSimple
|
||||
pointed
|
||||
class="mt-3 mx-3"
|
||||
style="height:70px"
|
||||
:data-points="[1, 18, 9, 17, 34, 22, 11]"
|
||||
point-hover-background-color="info"
|
||||
:options="{ elements: { line: { tension: 0.00001 }}}"
|
||||
label="Members"
|
||||
labels="months"
|
||||
/>
|
||||
</template>
|
||||
</CWidgetDropdown>
|
||||
</CCol>
|
||||
<CCol sm="6" lg="3">
|
||||
<CWidgetDropdown
|
||||
color="warning"
|
||||
header="9.823"
|
||||
text="Members online"
|
||||
>
|
||||
<template #default>
|
||||
<CDropdown
|
||||
color="transparent p-0"
|
||||
placement="bottom-end"
|
||||
>
|
||||
<template #toggler-content>
|
||||
<CIcon name="cil-settings"/>
|
||||
</template>
|
||||
<CDropdownItem>Action</CDropdownItem>
|
||||
<CDropdownItem>Another action</CDropdownItem>
|
||||
<CDropdownItem>Something else here...</CDropdownItem>
|
||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||
</CDropdown>
|
||||
</template>
|
||||
<template #footer>
|
||||
<CChartLineSimple
|
||||
class="mt-3"
|
||||
style="height:70px"
|
||||
background-color="rgba(255,255,255,.2)"
|
||||
:data-points="[78, 81, 80, 45, 34, 12, 40]"
|
||||
:options="{ elements: { line: { borderWidth: 2.5 }}}"
|
||||
point-hover-background-color="warning"
|
||||
label="Members"
|
||||
labels="months"
|
||||
/>
|
||||
</template>
|
||||
</CWidgetDropdown>
|
||||
</CCol>
|
||||
<CCol sm="6" lg="3">
|
||||
<CWidgetDropdown
|
||||
color="danger"
|
||||
header="9.823"
|
||||
text="Members online"
|
||||
>
|
||||
<template #default>
|
||||
<CDropdown
|
||||
color="transparent p-0"
|
||||
placement="bottom-end"
|
||||
>
|
||||
<template #toggler-content>
|
||||
<CIcon name="cil-settings"/>
|
||||
</template>
|
||||
<CDropdownItem>Action</CDropdownItem>
|
||||
<CDropdownItem>Another action</CDropdownItem>
|
||||
<CDropdownItem>Something else here...</CDropdownItem>
|
||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||
</CDropdown>
|
||||
</template>
|
||||
<template #footer>
|
||||
<CChartBarSimple
|
||||
class="mt-3 mx-3"
|
||||
style="height:70px"
|
||||
background-color="rgb(250, 152, 152)"
|
||||
label="Members"
|
||||
labels="months"
|
||||
/>
|
||||
</template>
|
||||
</CWidgetDropdown>
|
||||
</CCol>
|
||||
</CRow>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'WidgetsDropdown',
|
||||
layout: 'admin'
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user