%PDF- %PDF-
Direktori : /home/ugotscom/3vfm3/resources/js/components/clients/ |
Current File : /home/ugotscom/3vfm3/resources/js/components/clients/clients2.vue |
<template> <div class="container"> <div class="row"> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Total Clients</div> <div class="h5 mb-0 font-weight-bold text-gray-800"> <p></p></div> <router-link @click="say()">click me</router-link> </div> </div> </div> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Clients</div> <div class="h5 mb-0 font-weight-bold text-gray-800">220</div> </div> </div> </div> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Current Projects</div> <div class="h5 mb-0 font-weight-bold text-gray-800">12</div> </div> </div> </div> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Leads</div> <div class="h5 mb-0 font-weight-bold text-gray-800">220</div> </div> </div> </div> </div> <div class="row justify-content-center"> <div class="col-md-12"> <input type="text" class="form-control" @input="isTyping = true" v-model="searchQuery" placeholder="Type your keyword"> <table class="table table-bordered"> <thead> <tr> <th scope="col">#</th> <th scope="col">Company Name</th> <th scope="col">Phone</th> <th scope="col">Email</th> <th scope="col">Actions</th> </tr> </thead> <tbody> <tr v-for ="user in users.data" :key="user.id"> <th scope="row">{{user.id}}</th> <td>{{user.name}}</td> <td>{{user.phone}}</td> <td>{{user.email}}</td> <td>{{user.status}}</td> <td><router-link ></router-link></td> <td><router-link v-bind:to="'/viewclient/'+user.id">View</router-link></td> </tr> </tbody> </table> <pagination :data="users" @pagination-change-page="getResults"></pagination> </div> </div> </div> </template> <script> export default { data(){ return { users:{}, tasks:[], searchQuery:'', isTyping: false, isLoading: false, } }, watch: { searchQuery: _.debounce(function() { this.isTyping = false; }, 1000), isTyping: function(value) { if (!value) { this.searchUser(this.searchQuery); } } }, methods:{ searchUser: function(searchQuery) { this.isLoading = true; axios.get('client/searchquery?q=' + searchQuery) .then(response => { this.isLoading = false; this.users = response.data; }); }, getResults:function(page = 1) { axios.get('client?page=' + page) .then(response => { this.users = response.data; }); }, loadusers:function(){ axios.get('/client').then(({data})=> (this.users = data)); }, getPosts:function () { axios.get('/client').then(function(response){ this.rows = response.data; }.bind(this)); }, }, created: function(){ this.loadusers(), this.loadtasks() }, } </script>