hesabixCore/webUI/src/views/acc/settings/logs.vue

117 lines
2.7 KiB
Vue
Raw Normal View History

2025-03-21 14:20:43 +03:30
<template>
<!-- هدر -->
<v-toolbar color="toolbar" title="تاریخچه رویدادها" flat>
<template v-slot:prepend>
<v-tooltip text="بازگشت" location="bottom">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" @click="$router.back()" class="d-none d-sm-flex" variant="text" icon="mdi-arrow-right" />
</template>
</v-tooltip>
</template>
</v-toolbar>
2025-03-21 14:20:43 +03:30
<v-text-field
v-model="search"
prepend-inner-icon="mdi-magnify"
label="جست و جو ..."
variant="outlined"
density="compact"
hide-details
class="mb-0"
:rounded="0"
></v-text-field>
<!-- جدول -->
<v-data-table
:headers="headers"
:items="items"
:search="search"
:loading="loading"
hover
:header-props="{ class: 'custom-header' }"
class="elevation-1"
>
<!-- لودینگ -->
<template v-slot:loading>
<v-skeleton-loader
type="table-row"
class="my-2"
></v-skeleton-loader>
</template>
<!-- پیام خالی بودن -->
<template v-slot:no-data>
اطلاعاتی برای نمایش وجود ندارد
</template>
<!-- پیام نتیجه جستجو -->
<template v-slot:no-results>
نتیجهای یافت نشد
</template>
</v-data-table>
2025-03-21 14:20:43 +03:30
</template>
<script>
import { ref } from 'vue'
import axios from 'axios'
2025-03-21 14:20:43 +03:30
export default {
name: 'logs',
data() {
return {
search: '',
loading: true,
items: [],
headers: [
{
title: 'تاریخ',
align: 'center',
key: 'date',
},
{
title: 'کاربر',
align: 'center',
key: 'user',
},
{
title: 'توضیحات',
align: 'center',
key: 'des',
},
{
title: 'بخش',
align: 'center',
key: 'part',
},
{
title: 'آی پی آدرس',
align: 'center',
key: 'ipaddress',
},
],
}
},
2025-03-21 14:20:43 +03:30
methods: {
async loadData() {
try {
const response = await axios.post('/api/business/logs/' + localStorage.getItem('activeBid'))
this.items = response.data
} catch (error) {
console.error('خطا در دریافت اطلاعات:', error)
} finally {
this.loading = false
}
2025-03-21 14:20:43 +03:30
}
},
mounted() {
this.loadData()
2025-03-21 14:20:43 +03:30
}
}
</script>
<style>
.v-data-table th {
white-space: nowrap;
}
2025-03-21 14:20:43 +03:30
</style>