mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Fix TypeScript configuration and type errors
This commit is contained in:
@@ -91,6 +91,20 @@ interface Statistics {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface WebSocketMessage {
|
||||||
|
type: 'new_request' | 'status_update';
|
||||||
|
data?: Request;
|
||||||
|
statistics?: {
|
||||||
|
total: number;
|
||||||
|
by_status: {
|
||||||
|
new: number;
|
||||||
|
in_progress: number;
|
||||||
|
completed: number;
|
||||||
|
rejected: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const requests = ref<Request[]>([])
|
const requests = ref<Request[]>([])
|
||||||
const statistics = ref<Statistics>({
|
const statistics = ref<Statistics>({
|
||||||
total: 0,
|
total: 0,
|
||||||
@@ -103,7 +117,7 @@ const statistics = ref<Statistics>({
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Обработчик WebSocket сообщений
|
// Обработчик WebSocket сообщений
|
||||||
const handleWebSocketMessage = (data: any) => {
|
const handleWebSocketMessage = (data: WebSocketMessage) => {
|
||||||
console.log('AdminDashboard: Received WebSocket message:', data)
|
console.log('AdminDashboard: Received WebSocket message:', data)
|
||||||
|
|
||||||
if (data.type === 'new_request' || data.type === 'status_update') {
|
if (data.type === 'new_request' || data.type === 'status_update') {
|
||||||
@@ -167,7 +181,7 @@ const fetchData = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getPriorityClass = (priority: 'high' | 'medium' | 'low'): string => {
|
const getPriorityClass = (priority: 'high' | 'medium' | 'low'): string => {
|
||||||
const classes = {
|
const classes: Record<'high' | 'medium' | 'low', string> = {
|
||||||
high: 'text-red-600',
|
high: 'text-red-600',
|
||||||
medium: 'text-yellow-600',
|
medium: 'text-yellow-600',
|
||||||
low: 'text-green-600'
|
low: 'text-green-600'
|
||||||
@@ -176,7 +190,7 @@ const getPriorityClass = (priority: 'high' | 'medium' | 'low'): string => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getStatusClass = (status: 'new' | 'in_progress' | 'completed' | 'rejected'): string => {
|
const getStatusClass = (status: 'new' | 'in_progress' | 'completed' | 'rejected'): string => {
|
||||||
const classes = {
|
const classes: Record<'new' | 'in_progress' | 'completed' | 'rejected', string> = {
|
||||||
new: 'text-blue-600',
|
new: 'text-blue-600',
|
||||||
in_progress: 'text-yellow-600',
|
in_progress: 'text-yellow-600',
|
||||||
completed: 'text-green-600',
|
completed: 'text-green-600',
|
||||||
|
|||||||
@@ -1,42 +1,41 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "esnext",
|
||||||
"useDefineForClassFields": true,
|
"module": "esnext",
|
||||||
"module": "ESNext",
|
|
||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
||||||
"skipLibCheck": true,
|
|
||||||
|
|
||||||
/* Bundler mode */
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"jsx": "preserve",
|
|
||||||
|
|
||||||
/* Linting */
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": false,
|
"jsx": "preserve",
|
||||||
"noUnusedParameters": false,
|
"moduleResolution": "node",
|
||||||
"noFallthroughCasesInSwitch": true,
|
"skipLibCheck": true,
|
||||||
|
|
||||||
/* Paths */
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["./src/*"]
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Additional Options */
|
|
||||||
"allowJs": true,
|
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"types": ["vite/client", "node"]
|
"useDefineForClassFields": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"types": [
|
||||||
|
"webpack-env",
|
||||||
|
"node"
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"scripthost"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.d.ts",
|
|
||||||
"src/**/*.tsx",
|
"src/**/*.tsx",
|
||||||
"src/**/*.vue"
|
"src/**/*.vue",
|
||||||
|
"tests/**/*.ts",
|
||||||
|
"tests/**/*.tsx"
|
||||||
],
|
],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://backend:8000',
|
target: 'http://localhost:8000',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false
|
secure: false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user