2025-09-24 14:27:13 +08:00
|
|
|
@echo off
|
2025-09-24 14:30:50 +08:00
|
|
|
chcp 65001 >nul 2>&1
|
2025-09-24 14:27:13 +08:00
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
|
|
|
|
|
|
:: ========================================
|
2025-09-24 14:30:50 +08:00
|
|
|
:: Education System - Windows Startup Script
|
2025-09-24 14:27:13 +08:00
|
|
|
:: ========================================
|
|
|
|
|
|
|
|
|
|
:MAIN_MENU
|
|
|
|
|
cls
|
|
|
|
|
echo ========================================
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Education System - Smart Launcher
|
2025-09-24 14:27:13 +08:00
|
|
|
echo ========================================
|
|
|
|
|
echo.
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Select an option:
|
2025-09-24 14:27:13 +08:00
|
|
|
echo.
|
2025-09-24 14:30:50 +08:00
|
|
|
echo 0 - Start All Industries
|
2025-09-24 14:27:13 +08:00
|
|
|
echo --------------
|
2025-09-24 14:30:50 +08:00
|
|
|
echo 1 - Cultural Tourism (Port: 5150)
|
|
|
|
|
echo 2 - Smart Manufacturing (Port: 5151)
|
|
|
|
|
echo 3 - Smart Development (Port: 5152)
|
|
|
|
|
echo 4 - Finance and Commerce (Port: 5153)
|
|
|
|
|
echo 5 - Visual Design (Port: 5154)
|
|
|
|
|
echo 6 - Transportation and Logistics (Port: 5155)
|
|
|
|
|
echo 7 - Healthcare (Port: 5156)
|
|
|
|
|
echo 8 - Civil and Water Engineering (Port: 5157)
|
|
|
|
|
echo 9 - Food Industry (Port: 5158)
|
|
|
|
|
echo 10 - Chemical Industry (Port: 5159)
|
|
|
|
|
echo 11 - Energy Industry (Port: 5160)
|
|
|
|
|
echo 12 - Environmental Protection (Port: 5161)
|
2025-09-24 14:27:13 +08:00
|
|
|
echo --------------
|
2025-09-24 14:30:50 +08:00
|
|
|
echo A - Stop All Industries
|
|
|
|
|
echo S - Check Status
|
|
|
|
|
echo Q - Exit
|
2025-09-24 14:27:13 +08:00
|
|
|
echo.
|
|
|
|
|
|
2025-09-24 14:30:50 +08:00
|
|
|
set /p choice=Enter your choice:
|
2025-09-24 14:27:13 +08:00
|
|
|
|
|
|
|
|
if "%choice%"=="0" goto START_ALL
|
|
|
|
|
if "%choice%"=="1" goto START_1
|
|
|
|
|
if "%choice%"=="2" goto START_2
|
|
|
|
|
if "%choice%"=="3" goto START_3
|
|
|
|
|
if "%choice%"=="4" goto START_4
|
|
|
|
|
if "%choice%"=="5" goto START_5
|
|
|
|
|
if "%choice%"=="6" goto START_6
|
|
|
|
|
if "%choice%"=="7" goto START_7
|
|
|
|
|
if "%choice%"=="8" goto START_8
|
|
|
|
|
if "%choice%"=="9" goto START_9
|
|
|
|
|
if "%choice%"=="10" goto START_10
|
|
|
|
|
if "%choice%"=="11" goto START_11
|
|
|
|
|
if "%choice%"=="12" goto START_12
|
2025-09-24 14:30:50 +08:00
|
|
|
if /i "%choice%"=="A" goto STOP_ALL
|
|
|
|
|
if /i "%choice%"=="S" goto CHECK_STATUS
|
|
|
|
|
if /i "%choice%"=="Q" goto EXIT
|
2025-09-24 14:27:13 +08:00
|
|
|
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Invalid option!
|
2025-09-24 14:27:13 +08:00
|
|
|
timeout /t 2 >nul
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_ALL
|
|
|
|
|
echo.
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Starting all industries...
|
|
|
|
|
call :START_INDUSTRY "frontend" "Cultural Tourism" 5150
|
|
|
|
|
call :START_INDUSTRY "frontend_智能制造" "Smart Manufacturing" 5151
|
|
|
|
|
call :START_INDUSTRY "frontend_智能开发" "Smart Development" 5152
|
|
|
|
|
call :START_INDUSTRY "frontend_财经商贸" "Finance Commerce" 5153
|
|
|
|
|
call :START_INDUSTRY "frontend_视觉设计" "Visual Design" 5154
|
|
|
|
|
call :START_INDUSTRY "frontend_交通物流" "Transportation" 5155
|
|
|
|
|
call :START_INDUSTRY "frontend_大健康" "Healthcare" 5156
|
|
|
|
|
call :START_INDUSTRY "frontend_土木水利" "Civil Engineering" 5157
|
|
|
|
|
call :START_INDUSTRY "frontend_食品" "Food Industry" 5158
|
|
|
|
|
call :START_INDUSTRY "frontend_化工" "Chemical Industry" 5159
|
|
|
|
|
call :START_INDUSTRY "frontend_能源" "Energy Industry" 5160
|
|
|
|
|
call :START_INDUSTRY "frontend_环保" "Environmental" 5161
|
2025-09-24 14:27:13 +08:00
|
|
|
echo.
|
2025-09-24 14:30:50 +08:00
|
|
|
echo All industries started!
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_1
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend" "Cultural Tourism" 5150
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_2
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_智能制造" "Smart Manufacturing" 5151
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_3
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_智能开发" "Smart Development" 5152
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_4
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_财经商贸" "Finance Commerce" 5153
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_5
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_视觉设计" "Visual Design" 5154
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_6
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_交通物流" "Transportation" 5155
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_7
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_大健康" "Healthcare" 5156
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_8
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_土木水利" "Civil Engineering" 5157
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_9
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_食品" "Food Industry" 5158
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_10
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_化工" "Chemical Industry" 5159
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_11
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_能源" "Energy Industry" 5160
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_12
|
2025-09-24 14:30:50 +08:00
|
|
|
call :START_INDUSTRY "frontend_环保" "Environmental" 5161
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:START_INDUSTRY
|
2025-09-24 14:30:50 +08:00
|
|
|
set "dir=%~1"
|
|
|
|
|
set "name=%~2"
|
|
|
|
|
set "port=%~3"
|
2025-09-24 14:27:13 +08:00
|
|
|
|
|
|
|
|
echo.
|
|
|
|
|
echo ========================================
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Starting %name% (Port: %port%)
|
2025-09-24 14:27:13 +08:00
|
|
|
echo ========================================
|
|
|
|
|
|
|
|
|
|
if not exist "%dir%" (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [ERROR] Directory %dir% does not exist!
|
2025-09-24 14:27:13 +08:00
|
|
|
exit /b 1
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-24 14:30:50 +08:00
|
|
|
netstat -an | findstr ":%port%" >nul 2>&1
|
2025-09-24 14:27:13 +08:00
|
|
|
if %errorlevel%==0 (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [WARNING] Port %port% is already in use
|
|
|
|
|
set /p stop_choice=Stop existing service and restart? (y/n):
|
2025-09-24 14:27:13 +08:00
|
|
|
if /i "!stop_choice!"=="y" (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Stopping service on port %port%...
|
2025-09-24 14:27:13 +08:00
|
|
|
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":%port%"') do (
|
|
|
|
|
taskkill /F /PID %%a >nul 2>&1
|
|
|
|
|
)
|
|
|
|
|
timeout /t 2 >nul
|
|
|
|
|
) else (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Skipping %name%
|
2025-09-24 14:27:13 +08:00
|
|
|
exit /b 1
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-24 14:30:50 +08:00
|
|
|
cd "%dir%" 2>nul
|
2025-09-24 14:27:13 +08:00
|
|
|
if not exist "node_modules" (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [INFO] Dependencies not found, installing...
|
|
|
|
|
echo This may take 1-3 minutes, please wait...
|
2025-09-24 14:27:13 +08:00
|
|
|
call npm install
|
|
|
|
|
if !errorlevel! neq 0 (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [ERROR] Failed to install dependencies for %name%!
|
2025-09-24 14:27:13 +08:00
|
|
|
cd ..
|
|
|
|
|
exit /b 1
|
|
|
|
|
)
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [SUCCESS] Dependencies installed for %name%!
|
2025-09-24 14:27:13 +08:00
|
|
|
) else (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [INFO] Dependencies already exist for %name%
|
2025-09-24 14:27:13 +08:00
|
|
|
)
|
|
|
|
|
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [INFO] Starting %name%...
|
2025-09-24 14:27:13 +08:00
|
|
|
start /min cmd /c "npm run dev"
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
timeout /t 3 >nul
|
|
|
|
|
|
2025-09-24 14:30:50 +08:00
|
|
|
netstat -an | findstr ":%port%" >nul 2>&1
|
2025-09-24 14:27:13 +08:00
|
|
|
if %errorlevel%==0 (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [SUCCESS] %name% started successfully!
|
|
|
|
|
echo Access URL: http://localhost:%port%
|
2025-09-24 14:27:13 +08:00
|
|
|
) else (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [ERROR] Failed to start %name%!
|
2025-09-24 14:27:13 +08:00
|
|
|
exit /b 1
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
|
|
:STOP_ALL
|
|
|
|
|
echo.
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Stopping all industry services...
|
2025-09-24 14:27:13 +08:00
|
|
|
taskkill /F /IM node.exe >nul 2>&1
|
2025-09-24 14:30:50 +08:00
|
|
|
if %errorlevel%==0 (
|
|
|
|
|
echo All services stopped successfully!
|
|
|
|
|
) else (
|
|
|
|
|
echo No running services found.
|
|
|
|
|
)
|
2025-09-24 14:27:13 +08:00
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:CHECK_STATUS
|
|
|
|
|
cls
|
|
|
|
|
echo ========================================
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Industry Running Status
|
2025-09-24 14:27:13 +08:00
|
|
|
echo ========================================
|
|
|
|
|
echo.
|
2025-09-24 14:30:50 +08:00
|
|
|
call :CHECK_PORT 5150 "Cultural Tourism"
|
|
|
|
|
call :CHECK_PORT 5151 "Smart Manufacturing"
|
|
|
|
|
call :CHECK_PORT 5152 "Smart Development"
|
|
|
|
|
call :CHECK_PORT 5153 "Finance Commerce"
|
|
|
|
|
call :CHECK_PORT 5154 "Visual Design"
|
|
|
|
|
call :CHECK_PORT 5155 "Transportation"
|
|
|
|
|
call :CHECK_PORT 5156 "Healthcare"
|
|
|
|
|
call :CHECK_PORT 5157 "Civil Engineering"
|
|
|
|
|
call :CHECK_PORT 5158 "Food Industry"
|
|
|
|
|
call :CHECK_PORT 5159 "Chemical Industry"
|
|
|
|
|
call :CHECK_PORT 5160 "Energy Industry"
|
|
|
|
|
call :CHECK_PORT 5161 "Environmental"
|
2025-09-24 14:27:13 +08:00
|
|
|
echo.
|
|
|
|
|
pause
|
|
|
|
|
goto MAIN_MENU
|
|
|
|
|
|
|
|
|
|
:CHECK_PORT
|
2025-09-24 14:30:50 +08:00
|
|
|
netstat -an | findstr ":%1" >nul 2>&1
|
2025-09-24 14:27:13 +08:00
|
|
|
if %errorlevel%==0 (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [RUNNING] %~2 - Port: %1 - http://localhost:%1
|
2025-09-24 14:27:13 +08:00
|
|
|
) else (
|
2025-09-24 14:30:50 +08:00
|
|
|
echo [STOPPED] %~2 - Port: %1
|
2025-09-24 14:27:13 +08:00
|
|
|
)
|
|
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
|
|
:EXIT
|
2025-09-24 14:30:50 +08:00
|
|
|
echo Goodbye!
|
2025-09-24 14:27:13 +08:00
|
|
|
exit
|