From bbe825313abd220bb563abda5999ea4dedd0eefa Mon Sep 17 00:00:00 2001 From: Juan Felipe Zapata Moreno Date: Thu, 14 Aug 2025 15:49:46 -0600 Subject: [PATCH] =?UTF-8?q?Se=20agreg=C3=B3=20las=20gr=C3=A1ficas=20a=20Tr?= =?UTF-8?q?amites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 32 +- package.json | 2 + .../js/Components/Dashboard/Charts/Bars.vue | 34 ++ .../js/Components/Dashboard/Charts/Lines.vue | 32 ++ .../js/Components/Dashboard/Charts/Pie.vue | 29 + .../Dashboard/Charts/StackedBar.vue | 42 ++ .../Components/Dashboard/Form/DateRange.vue | 118 +++++ resources/js/Layouts/DashboardLayout.vue | 17 +- resources/js/Pages/Dashboard/Tramites.vue | 494 ++++++++++++++++++ routes/web.php | 83 +-- 10 files changed, 837 insertions(+), 46 deletions(-) create mode 100644 resources/js/Components/Dashboard/Charts/Bars.vue create mode 100644 resources/js/Components/Dashboard/Charts/Lines.vue create mode 100644 resources/js/Components/Dashboard/Charts/Pie.vue create mode 100644 resources/js/Components/Dashboard/Charts/StackedBar.vue create mode 100644 resources/js/Components/Dashboard/Form/DateRange.vue create mode 100644 resources/js/Pages/Dashboard/Tramites.vue diff --git a/package-lock.json b/package-lock.json index 9fbf9e7..e8c9c45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "template-laravel-vuejs", + "name": "maquetador-graficas", "lockfileVersion": 3, "requires": true, "packages": { @@ -8,12 +8,14 @@ "@inertiajs/vue3": "^1.0.0-beta.2", "@soketi/soketi": "^1.6.0", "@vueuse/core": "^9.6.0", + "chart.js": "^4.5.0", "dotenv": "^16.3.1", "express": "^4.18.2", "laravel-echo": "^1.14.2", "pusher-js": "^7.5.0", "sweetalert2": "^11.4.8", "toastr": "^2.1.4", + "vue-chartjs": "^5.3.2", "vue-i18n": "^9.2.2", "vue-multiselect": "^3.0.0-alpha.2" }, @@ -523,6 +525,12 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@kurkle/color": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", + "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==", + "license": "MIT" + }, "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.2.tgz", @@ -1678,6 +1686,18 @@ "resolved": "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz", "integrity": "sha512-syedaZ9cPe7r3hoQA9twWYKu5AIyCswN5+szkmPBe9ccdLrj4bYaCnLVPTLd2kgVRc7+zoX4tyPgRnFKCj5YjQ==" }, + "node_modules/chart.js": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.0.tgz", + "integrity": "sha512-aYeC/jDgSEx8SHWZvANYMioYMZ2KX02W6f6uVfyteuCGcadDLcYVHdfdygsTQkQ4TKn5lghoojAsPj5pu0SnvQ==", + "license": "MIT", + "dependencies": { + "@kurkle/color": "^0.3.0" + }, + "engines": { + "pnpm": ">=8" + } + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -5451,6 +5471,16 @@ } } }, + "node_modules/vue-chartjs": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/vue-chartjs/-/vue-chartjs-5.3.2.tgz", + "integrity": "sha512-NrkbRRoYshbXbWqJkTN6InoDVwVb90C0R7eAVgMWcB9dPikbruaOoTFjFYHE/+tNPdIe6qdLCDjfjPHQ0fw4jw==", + "license": "MIT", + "peerDependencies": { + "chart.js": "^4.1.1", + "vue": "^3.0.0-0 || ^2.7.0" + } + }, "node_modules/vue-i18n": { "version": "9.7.1", "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.7.1.tgz", diff --git a/package.json b/package.json index cf5cb41..1778756 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,14 @@ "@inertiajs/vue3": "^1.0.0-beta.2", "@soketi/soketi": "^1.6.0", "@vueuse/core": "^9.6.0", + "chart.js": "^4.5.0", "dotenv": "^16.3.1", "express": "^4.18.2", "laravel-echo": "^1.14.2", "pusher-js": "^7.5.0", "sweetalert2": "^11.4.8", "toastr": "^2.1.4", + "vue-chartjs": "^5.3.2", "vue-i18n": "^9.2.2", "vue-multiselect": "^3.0.0-alpha.2" } diff --git a/resources/js/Components/Dashboard/Charts/Bars.vue b/resources/js/Components/Dashboard/Charts/Bars.vue new file mode 100644 index 0000000..2c4513a --- /dev/null +++ b/resources/js/Components/Dashboard/Charts/Bars.vue @@ -0,0 +1,34 @@ + + + diff --git a/resources/js/Components/Dashboard/Charts/Lines.vue b/resources/js/Components/Dashboard/Charts/Lines.vue new file mode 100644 index 0000000..9b5a718 --- /dev/null +++ b/resources/js/Components/Dashboard/Charts/Lines.vue @@ -0,0 +1,32 @@ + + + diff --git a/resources/js/Components/Dashboard/Charts/Pie.vue b/resources/js/Components/Dashboard/Charts/Pie.vue new file mode 100644 index 0000000..3d4073a --- /dev/null +++ b/resources/js/Components/Dashboard/Charts/Pie.vue @@ -0,0 +1,29 @@ + + + diff --git a/resources/js/Components/Dashboard/Charts/StackedBar.vue b/resources/js/Components/Dashboard/Charts/StackedBar.vue new file mode 100644 index 0000000..2ebd952 --- /dev/null +++ b/resources/js/Components/Dashboard/Charts/StackedBar.vue @@ -0,0 +1,42 @@ + + + diff --git a/resources/js/Components/Dashboard/Form/DateRange.vue b/resources/js/Components/Dashboard/Form/DateRange.vue new file mode 100644 index 0000000..aace826 --- /dev/null +++ b/resources/js/Components/Dashboard/Form/DateRange.vue @@ -0,0 +1,118 @@ + + + diff --git a/resources/js/Layouts/DashboardLayout.vue b/resources/js/Layouts/DashboardLayout.vue index 0b72714..b26c1cb 100644 --- a/resources/js/Layouts/DashboardLayout.vue +++ b/resources/js/Layouts/DashboardLayout.vue @@ -35,7 +35,7 @@ onMounted(()=> { :title="title" />
- -
diff --git a/resources/js/Pages/Dashboard/Tramites.vue b/resources/js/Pages/Dashboard/Tramites.vue new file mode 100644 index 0000000..7514808 --- /dev/null +++ b/resources/js/Pages/Dashboard/Tramites.vue @@ -0,0 +1,494 @@ + + + diff --git a/routes/web.php b/routes/web.php index 2ad00e1..f4d5f1b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -7,86 +7,91 @@ use App\Http\Controllers\Developer\RoleController; use App\Http\Controllers\Example\IndexController as ExampleIndexController; use Illuminate\Support\Facades\Route; +use Illuminate\Support\Facades\Http; /** * Rutas generales/publicas - * + * * Rutas accesibles por todos los usuarios y no usuarios */ Route::redirect('/', '/login'); /** * Rutas del Dashboard - * + * * El dashboard es el panel de los usuarios de forma general */ Route::prefix('dashboard')->name('dashboard.')->middleware([ - 'auth:sanctum', - 'verified', - config('jetstream.auth_session') + 'auth:sanctum', + 'verified', + config('jetstream.auth_session') ])->group(function () { - Route::get('/welcome', [IndexController::class, 'index'])->name('index'); - Route::inertia('/changelogs', 'Dashboard/Changelogs')->name('changelogs'); - Route::inertia('/help', 'Dashboard/Help')->name('help'); + Route::get('/welcome', [IndexController::class, 'index'])->name('index'); + Route::inertia('/changelogs', 'Dashboard/Changelogs')->name('changelogs'); + Route::inertia('/help', 'Dashboard/Help')->name('help'); - # Log de Acciones - Route::resource('histories', HistoryLogController::class)->only([ - 'index', - 'store' - ]); + Route::inertia('/api-example', 'Dashboard/Tramites')->name('api-example'); + Route::get('/api/proxy-reporte-especial', function () { + $response = Http::get('https://tramites.comalcalco.gob.mx/reporte-especial?type=api'); + return $response->json(); + }); - Route::resource('notifications', NotificationController::class); - Route::prefix('/users')->name('users.')->group(function() - { - Route::get('/notifications', [UserController::class, 'getNotifications'])->name('notifications'); - }); + # Log de Acciones + Route::resource('histories', HistoryLogController::class)->only([ + 'index', + 'store' + ]); + + Route::resource('notifications', NotificationController::class); + Route::prefix('/users')->name('users.')->group(function () { + Route::get('/notifications', [UserController::class, 'getNotifications'])->name('notifications'); + }); }); /** * Rutas de administrador - * + * * Estas ubicaciones son del administrador, sin embargo el desarrollador * puede acceder a ellas. */ Route::prefix('admin')->name('admin.')->middleware([ - 'auth:sanctum', - config('jetstream.auth_session') + 'auth:sanctum', + config('jetstream.auth_session') ])->group(function () { - Route::resource('users', UserController::class); + Route::resource('users', UserController::class); - Route::prefix('/users')->name('users.')->group(function() - { - Route::get('{user}/settings', [UserController::class, 'settings'])->name('settings'); - Route::post('/password', [UserController::class, 'updatePassword'])->name('password'); - Route::post('/syncRoles', [UserController::class, 'syncRoles'])->name('syncRoles'); - }); + Route::prefix('/users')->name('users.')->group(function () { + Route::get('{user}/settings', [UserController::class, 'settings'])->name('settings'); + Route::post('/password', [UserController::class, 'updatePassword'])->name('password'); + Route::post('/syncRoles', [UserController::class, 'syncRoles'])->name('syncRoles'); + }); }); /** * Rutas solo del desarrollador - * + * * Son ubicaciones o funciones que pueden llegar a ser muy sensibles en el sistema, por lo que * solo el desarrollador debe de ser capaz de modificarlas o actualizarlas. */ Route::prefix('developer')->name('developer.')->middleware([ - 'auth:sanctum', - config('jetstream.auth_session') + 'auth:sanctum', + config('jetstream.auth_session') ])->group(function () { - Route::resource('roles', RoleController::class); + Route::resource('roles', RoleController::class); }); /** * Elementos de la plantilla - * + * * Estos son elementos que existen y pueden ser usados en la plantilla, vienen ejemplos de uso. - * + * * Estas rutas pueden ser comentadas o eliminadas cuando se finalice un proyecto. Por default estan ocultas * en el dashboard. */ Route::prefix('examples')->name('examples.')->middleware([ - 'auth:sanctum', - 'verified', - config('jetstream.auth_session') + 'auth:sanctum', + 'verified', + config('jetstream.auth_session') ])->group(function () { - Route::get('/', [ExampleIndexController::class, 'index'])->name('index'); -}); \ No newline at end of file + Route::get('/', [ExampleIndexController::class, 'index'])->name('index'); +});