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 statistics = ref<Statistics>({
|
||||
total: 0,
|
||||
@@ -103,7 +117,7 @@ const statistics = ref<Statistics>({
|
||||
})
|
||||
|
||||
// Обработчик WebSocket сообщений
|
||||
const handleWebSocketMessage = (data: any) => {
|
||||
const handleWebSocketMessage = (data: WebSocketMessage) => {
|
||||
console.log('AdminDashboard: Received WebSocket message:', data)
|
||||
|
||||
if (data.type === 'new_request' || data.type === 'status_update') {
|
||||
@@ -167,7 +181,7 @@ const fetchData = async () => {
|
||||
}
|
||||
|
||||
const getPriorityClass = (priority: 'high' | 'medium' | 'low'): string => {
|
||||
const classes = {
|
||||
const classes: Record<'high' | 'medium' | 'low', string> = {
|
||||
high: 'text-red-600',
|
||||
medium: 'text-yellow-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 classes = {
|
||||
const classes: Record<'new' | 'in_progress' | 'completed' | 'rejected', string> = {
|
||||
new: 'text-blue-600',
|
||||
in_progress: 'text-yellow-600',
|
||||
completed: 'text-green-600',
|
||||
|
@@ -1,42 +1,41 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "preserve",
|
||||
|
||||
/* Linting */
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"strict": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
/* Paths */
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
|
||||
/* Additional Options */
|
||||
"allowJs": true,
|
||||
"jsx": "preserve",
|
||||
"moduleResolution": "node",
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": 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": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.d.ts",
|
||||
"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: {
|
||||
'/api': {
|
||||
target: 'http://backend:8000',
|
||||
target: 'http://localhost:8000',
|
||||
changeOrigin: true,
|
||||
secure: false
|
||||
}
|
||||
|
Reference in New Issue
Block a user