mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 18:01:06 +03:30
ss
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
import { Bar, mixins } from 'vue-chartjs'
|
||||
const { reactiveProp } = mixins
|
||||
|
||||
export default {
|
||||
extends: Bar,
|
||||
mixins: [reactiveProp],
|
||||
props: ['options'],
|
||||
mounted () {
|
||||
// this.chartData is created in the mixin.
|
||||
// If you want to pass options please create a local options object
|
||||
this.renderChart(this.chartData, this.options)
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { Line, mixins } from 'vue-chartjs'
|
||||
const { reactiveProp } = mixins
|
||||
|
||||
export default {
|
||||
extends: Line,
|
||||
mixins: [reactiveProp],
|
||||
props: ['options'],
|
||||
mounted () {
|
||||
// this.chartData is created in the mixin.
|
||||
// If you want to pass options please create a local options object
|
||||
this.renderChart(this.chartData, this.options)
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { Pie, mixins } from 'vue-chartjs'
|
||||
const { reactiveProp } = mixins
|
||||
|
||||
export default {
|
||||
extends: Pie,
|
||||
mixins: [reactiveProp],
|
||||
props: ['options'],
|
||||
mounted () {
|
||||
// this.chartData is created in the mixin.
|
||||
// If you want to pass options please create a local options object
|
||||
this.renderChart(this.chartData, this.options)
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -106,4 +106,9 @@ export default [
|
||||
name: 'NotVerifyTestResult',
|
||||
view: 'TestResult/List'
|
||||
},
|
||||
{
|
||||
path: '/statistics',
|
||||
name: 'Statistics',
|
||||
view: 'Statistics/Chart'
|
||||
},
|
||||
]
|
||||
|
||||
+3
-6
@@ -95,7 +95,7 @@ const UserService = {
|
||||
**/
|
||||
logout: async function() {
|
||||
try {
|
||||
const response = await ApiService.post(urls.logout);
|
||||
await ApiService.post(urls.logout);
|
||||
// Remove the token and remove Authorization header from Api Service as well
|
||||
TokenService.removeToken();
|
||||
TokenService.removeRefreshToken();
|
||||
@@ -105,12 +105,9 @@ const UserService = {
|
||||
// NOTE: Again, we'll cover the 401 Interceptor a bit later.
|
||||
ApiService.unmount401Interceptor();
|
||||
|
||||
return response.data;
|
||||
return true;
|
||||
} catch (error) {
|
||||
throw new AuthenticationError(
|
||||
error.response.status,
|
||||
error.response.data.detail
|
||||
);
|
||||
return true
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import axios from "axios";
|
||||
import toast from "./toast.service";
|
||||
import {TokenService, ApiService} from '@/services';
|
||||
import store from "@/store"
|
||||
import router from '@/router'
|
||||
function errorResponseHandler(error) {
|
||||
|
||||
// check for errorHandle config
|
||||
@@ -26,6 +28,8 @@ function errorResponseHandler(error) {
|
||||
TokenService.removeRefreshToken();
|
||||
TokenService.removeInfo();
|
||||
ApiService.removeAuthHeader();
|
||||
store.commit('auth/logoutSuccess', {}, {root: true})
|
||||
router.push({ name: `Dashboard` });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ export default {
|
||||
},
|
||||
|
||||
async logout({ commit }) {
|
||||
const result = await UserService.logout();
|
||||
await UserService.logout();
|
||||
commit('logoutSuccess')
|
||||
router.push('/login')
|
||||
},
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div class="small">
|
||||
<pie-chart :chart-data="datacollection"></pie-chart>
|
||||
<bar-chart :chart-data="datacollection"></bar-chart>
|
||||
<button @click="fillData()">Randomize</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BarChart from '@/plugins/chart/BarChart.js'
|
||||
import PieChart from '@/plugins/chart/PieChart.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BarChart,
|
||||
PieChart
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
datacollection: null
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.fillData()
|
||||
},
|
||||
methods: {
|
||||
fillData () {
|
||||
this.datacollection = {
|
||||
labels: [this.getRandomInt(), this.getRandomInt()],
|
||||
datasets: [
|
||||
{
|
||||
label: 'Data One',
|
||||
backgroundColor: ['#f87979', '#ccc'],
|
||||
data: [this.getRandomInt(), this.getRandomInt()]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
getRandomInt () {
|
||||
return Math.floor(Math.random() * (50 - 5 + 1)) + 5
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.small {
|
||||
max-width: 600px;
|
||||
margin: 150px auto;
|
||||
}
|
||||
</style>
|
||||
@@ -73,7 +73,7 @@
|
||||
<v-flex :class="['pa-2', item.size]" v-for="(item, key) in form" :key="key">
|
||||
<v-text-field
|
||||
v-if="item.type == 'Text'"
|
||||
v-model="formData[item.name]"
|
||||
v-model="formData[item.id]"
|
||||
:label="item.name"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
@@ -81,7 +81,7 @@
|
||||
multiple
|
||||
v-if="item.type == 'Select'"
|
||||
:items="item.options"
|
||||
v-model="formData[item.name]"
|
||||
v-model="formData[item.id]"
|
||||
:label="item.name"
|
||||
color="black"
|
||||
item-text="title"
|
||||
@@ -93,7 +93,7 @@
|
||||
v-for="(optionValue, keyOption) in item.options"
|
||||
:key="keyOption"
|
||||
:label="optionValue.title"
|
||||
v-model="formData[item.name]"
|
||||
v-model="formData[item.id]"
|
||||
:value="optionValue.id"
|
||||
></v-checkbox>
|
||||
</v-container>
|
||||
@@ -109,7 +109,7 @@
|
||||
>
|
||||
<v-text-field
|
||||
v-if="children.type == 'Text'"
|
||||
v-model="formData[children.name]"
|
||||
v-model="formData[children.id]"
|
||||
:label="children.name"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
@@ -117,7 +117,7 @@
|
||||
multiple
|
||||
v-if="children.type == 'Select'"
|
||||
:items="children.options"
|
||||
v-model="formData[children.name]"
|
||||
v-model="formData[children.id]"
|
||||
:label="children.name"
|
||||
color="black"
|
||||
item-text="title"
|
||||
@@ -129,7 +129,7 @@
|
||||
v-for="(optionValue, keyOption) in children.options"
|
||||
:key="keyOption"
|
||||
:label="optionValue.title"
|
||||
v-model="formData[children.name]"
|
||||
v-model="formData[children.id]"
|
||||
:value="optionValue.id"
|
||||
></v-checkbox>
|
||||
</v-container>
|
||||
@@ -203,16 +203,16 @@ export default {
|
||||
for (const keyForm in result.data.data.inputs[key].children) {
|
||||
if (result.data.data.inputs[key].children.hasOwnProperty(keyForm)) {
|
||||
if (result.data.data.inputs[key].children[keyForm].type == 'Checkbox' || result.data.data.inputs[key].children[keyForm].type == 'Select' ) {
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].name] = [];
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].id] = [];
|
||||
} else {
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].name] = '';
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].id] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(result.data.data.inputs[key].type == 'Checkbox' || result.data.data.inputs[key].type == 'Select') {
|
||||
this.formData[result.data.data.inputs[key].name] = [];
|
||||
this.formData[result.data.data.inputs[key].id] = [];
|
||||
} else {
|
||||
this.formData[result.data.data.inputs[key].name] = '';
|
||||
this.formData[result.data.data.inputs[key].id] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,8 @@ export default {
|
||||
if (value && value.length > 0) {
|
||||
const pattern = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return pattern.test(value) || "Invalid e-mail.";
|
||||
} else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'failed' => 'These credentials do not match our records.',
|
||||
'failed' => 'These credentials do not match our records.',
|
||||
'logout_success' => 'You Have Been Successfully logged out!',
|
||||
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
|
||||
|
||||
];
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'failed' => 'Error',
|
||||
'failed_message' => "You've encountered an error",
|
||||
'success' => 'Success',
|
||||
'success_message' => 'Done Successfully',
|
||||
'create' => 'The Item created successfully',
|
||||
'update' => 'The Item updated successfully',
|
||||
|
||||
];
|
||||
<?php␍
|
||||
␍
|
||||
return [␍
|
||||
␍
|
||||
'failed' => 'Error',␍
|
||||
'failed_message' => "You've encountered an error",␍
|
||||
'success' => 'Success',␍
|
||||
'success_message' => 'Done Successfully',␍
|
||||
'create' => 'The Item created successfully',␍
|
||||
'update' => 'The Item updated successfully',␍
|
||||
'access_denied' => 'You dont have permission to do it',␍
|
||||
];␍
|
||||
|
||||
@@ -65,6 +65,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="{{ mix('vue/js/app.js') }}"></script>
|
||||
<script src="{{ mix('js/vue/app.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user