简化批处理文件,移除中文避免编码问题

- 移除中英文混合显示,改为纯英文主要内容
- 保留关键中文文件夹名称
- 修复echo语句中的特殊字符问题
- 简化菜单显示格式
This commit is contained in:
KQL
2025-09-24 14:47:46 +08:00
parent 641142039b
commit acea5e4b56

View File

@@ -10,32 +10,31 @@ setlocal enabledelayedexpansion
cls cls
echo ======================================== echo ========================================
echo Education System - Smart Launcher echo Education System - Smart Launcher
echo 教务系统 - 智能启动器
echo ======================================== echo ========================================
echo. echo.
echo Select an option / 请选择一个选项: echo Select an option:
echo. echo.
echo [0] Start All Industries / 启动所有产业 echo [0] Start All Industries
echo -------------- echo --------------
echo [1] Cultural Tourism / 文旅产业 (Port: 5150) echo [1] Cultural Tourism (Port: 5150)
echo [2] Smart Manufacturing / 智能制造 (Port: 5151) echo [2] Smart Manufacturing (Port: 5151)
echo [3] Smart Development / 智能开发 (Port: 5152) echo [3] Smart Development (Port: 5152)
echo [4] Finance and Commerce / 财经商贸 (Port: 5153) echo [4] Finance and Commerce (Port: 5153)
echo [5] Visual Design / 视觉设计 (Port: 5154) echo [5] Visual Design (Port: 5154)
echo [6] Transportation / 交通物流 (Port: 5155) echo [6] Transportation (Port: 5155)
echo [7] Healthcare / 大健康 (Port: 5156) echo [7] Healthcare (Port: 5156)
echo [8] Civil Engineering / 土木水利 (Port: 5157) echo [8] Civil Engineering (Port: 5157)
echo [9] Food Industry / 食品产业 (Port: 5158) echo [9] Food Industry (Port: 5158)
echo [10] Chemical Industry / 化工产业 (Port: 5159) echo [10] Chemical Industry (Port: 5159)
echo [11] Energy Industry / 能源产业 (Port: 5160) echo [11] Energy Industry (Port: 5160)
echo [12] Environmental / 环保产业 (Port: 5161) echo [12] Environmental (Port: 5161)
echo -------------- echo --------------
echo A - Stop All / 停止所有 echo [A] Stop All Services
echo S - Status / 查看状态 echo [S] Check Status
echo Q - Exit / 退出 echo [Q] Exit
echo. echo.
set /p choice="Enter your choice / 请输入选项: " set /p choice="Enter your choice: "
if "%choice%"=="0" goto START_ALL if "%choice%"=="0" goto START_ALL
if "%choice%"=="1" goto START_1 if "%choice%"=="1" goto START_1
@@ -54,87 +53,87 @@ if /i "%choice%"=="A" goto STOP_ALL
if /i "%choice%"=="S" goto CHECK_STATUS if /i "%choice%"=="S" goto CHECK_STATUS
if /i "%choice%"=="Q" goto EXIT if /i "%choice%"=="Q" goto EXIT
echo Invalid option! / 无效选项! echo Invalid option!
timeout /t 2 >nul timeout /t 2 >nul
goto MAIN_MENU goto MAIN_MENU
:START_ALL :START_ALL
echo. echo.
echo Starting all industries... / 正在启动所有产业... echo Starting all industries...
call :START_INDUSTRY frontend "Cultural Tourism / 文旅产业" 5150 call :START_INDUSTRY frontend "Cultural Tourism" 5150
call :START_INDUSTRY frontend_智能制造 "Smart Manufacturing / 智能制造" 5151 call :START_INDUSTRY frontend_智能制造 "Smart Manufacturing" 5151
call :START_INDUSTRY frontend_智能开发 "Smart Development / 智能开发" 5152 call :START_INDUSTRY frontend_智能开发 "Smart Development" 5152
call :START_INDUSTRY frontend_财经商贸 "Finance Commerce / 财经商贸" 5153 call :START_INDUSTRY frontend_财经商贸 "Finance Commerce" 5153
call :START_INDUSTRY frontend_视觉设计 "Visual Design / 视觉设计" 5154 call :START_INDUSTRY frontend_视觉设计 "Visual Design" 5154
call :START_INDUSTRY frontend_交通物流 "Transportation / 交通物流" 5155 call :START_INDUSTRY frontend_交通物流 "Transportation" 5155
call :START_INDUSTRY frontend_大健康 "Healthcare / 大健康" 5156 call :START_INDUSTRY frontend_大健康 "Healthcare" 5156
call :START_INDUSTRY frontend_土木水利 "Civil Engineering / 土木水利" 5157 call :START_INDUSTRY frontend_土木水利 "Civil Engineering" 5157
call :START_INDUSTRY frontend_食品 "Food Industry / 食品产业" 5158 call :START_INDUSTRY frontend_食品 "Food Industry" 5158
call :START_INDUSTRY frontend_化工 "Chemical Industry / 化工产业" 5159 call :START_INDUSTRY frontend_化工 "Chemical Industry" 5159
call :START_INDUSTRY frontend_能源 "Energy Industry / 能源产业" 5160 call :START_INDUSTRY frontend_能源 "Energy Industry" 5160
call :START_INDUSTRY frontend_环保 "Environmental / 环保产业" 5161 call :START_INDUSTRY frontend_环保 "Environmental" 5161
echo. echo.
echo All industries started! / 所有产业已启动! echo All industries started!
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_1 :START_1
call :START_INDUSTRY frontend "Cultural Tourism / 文旅产业" 5150 call :START_INDUSTRY frontend "Cultural Tourism" 5150
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_2 :START_2
call :START_INDUSTRY frontend_智能制造 "Smart Manufacturing / 智能制造" 5151 call :START_INDUSTRY frontend_智能制造 "Smart Manufacturing" 5151
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_3 :START_3
call :START_INDUSTRY frontend_智能开发 "Smart Development / 智能开发" 5152 call :START_INDUSTRY frontend_智能开发 "Smart Development" 5152
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_4 :START_4
call :START_INDUSTRY frontend_财经商贸 "Finance Commerce / 财经商贸" 5153 call :START_INDUSTRY frontend_财经商贸 "Finance Commerce" 5153
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_5 :START_5
call :START_INDUSTRY frontend_视觉设计 "Visual Design / 视觉设计" 5154 call :START_INDUSTRY frontend_视觉设计 "Visual Design" 5154
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_6 :START_6
call :START_INDUSTRY frontend_交通物流 "Transportation / 交通物流" 5155 call :START_INDUSTRY frontend_交通物流 "Transportation" 5155
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_7 :START_7
call :START_INDUSTRY frontend_大健康 "Healthcare / 大健康" 5156 call :START_INDUSTRY frontend_大健康 "Healthcare" 5156
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_8 :START_8
call :START_INDUSTRY frontend_土木水利 "Civil Engineering / 土木水利" 5157 call :START_INDUSTRY frontend_土木水利 "Civil Engineering" 5157
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_9 :START_9
call :START_INDUSTRY frontend_食品 "Food Industry / 食品产业" 5158 call :START_INDUSTRY frontend_食品 "Food Industry" 5158
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_10 :START_10
call :START_INDUSTRY frontend_化工 "Chemical Industry / 化工产业" 5159 call :START_INDUSTRY frontend_化工 "Chemical Industry" 5159
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_11 :START_11
call :START_INDUSTRY frontend_能源 "Energy Industry / 能源产业" 5160 call :START_INDUSTRY frontend_能源 "Energy Industry" 5160
pause pause
goto MAIN_MENU goto MAIN_MENU
:START_12 :START_12
call :START_INDUSTRY frontend_环保 "Environmental / 环保产业" 5161 call :START_INDUSTRY frontend_环保 "Environmental" 5161
pause pause
goto MAIN_MENU goto MAIN_MENU
@@ -151,58 +150,55 @@ echo ========================================
if not exist %dir% ( if not exist %dir% (
echo ERROR: Directory %dir% does not exist! echo ERROR: Directory %dir% does not exist!
echo 错误: 目录 %dir% 不存在!
exit /b 1 exit /b 1
) )
netstat -an | findstr ":%port%" >nul 2>&1 netstat -an | findstr ":%port%" >nul 2>&1
if %errorlevel%==0 ( if %errorlevel%==0 (
echo WARNING: Port %port% is already in use echo WARNING: Port %port% is already in use
echo 警告: 端口 %port% 已被占用 set /p stop_choice="Stop existing service? (y/n): "
set /p stop_choice="Stop existing service? (y/n) / 停止现有服务? (y/n): "
if /i "!stop_choice!"=="y" ( if /i "!stop_choice!"=="y" (
echo Stopping service... / 正在停止服务... echo Stopping service...
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":%port%"') do ( for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":%port%"') do (
taskkill /F /PID %%a >nul 2>&1 taskkill /F /PID %%a >nul 2>&1
) )
timeout /t 2 >nul timeout /t 2 >nul
) else ( ) else (
echo Skipping... / 跳过... echo Skipping...
exit /b 1 exit /b 1
) )
) )
cd %dir% 2>nul cd %dir% 2>nul
if not exist node_modules ( if not exist node_modules (
echo INFO: Installing dependencies... / 正在安装依赖... echo INFO: Installing dependencies...
echo Please wait 1-3 minutes... / 请等待1-3分钟... echo Please wait 1-3 minutes...
call npm install call npm install
if !errorlevel! neq 0 ( if !errorlevel! neq 0 (
echo ERROR: Installation failed! / 安装失败! echo ERROR: Installation failed!
cd .. cd ..
exit /b 1 exit /b 1
) )
echo SUCCESS: Dependencies installed! / 依赖安装完成! echo SUCCESS: Dependencies installed!
) else ( ) else (
echo INFO: Dependencies exist / 依赖已存在 echo INFO: Dependencies exist
) )
echo INFO: Starting service... / 正在启动服务... echo INFO: Starting service...
start /min cmd /c "npm run dev" start /min cmd /c "npm run dev"
cd .. cd ..
echo Waiting for startup... / 等待启动... echo Waiting for startup...
timeout /t 3 >nul timeout /t 3 >nul
netstat -an | findstr ":%port%" >nul 2>&1 netstat -an | findstr ":%port%" >nul 2>&1
if %errorlevel%==0 ( if %errorlevel%==0 (
echo SUCCESS: Started successfully! / 启动成功! echo SUCCESS: Started successfully!
echo. echo.
echo Access URL: http://localhost:%port% echo Access URL: http://localhost:%port%
echo 访问地址: http://localhost:%port%
echo. echo.
) else ( ) else (
echo ERROR: Failed to start! / 启动失败! echo ERROR: Failed to start!
exit /b 1 exit /b 1
) )
@@ -210,12 +206,12 @@ exit /b 0
:STOP_ALL :STOP_ALL
echo. echo.
echo Stopping all services... / 正在停止所有服务... echo Stopping all services...
taskkill /F /IM node.exe >nul 2>&1 taskkill /F /IM node.exe >nul 2>&1
if %errorlevel%==0 ( if %errorlevel%==0 (
echo All services stopped! / 所有服务已停止! echo All services stopped!
) else ( ) else (
echo No services running / 没有运行的服务 echo No services running
) )
pause pause
goto MAIN_MENU goto MAIN_MENU
@@ -223,23 +219,23 @@ goto MAIN_MENU
:CHECK_STATUS :CHECK_STATUS
cls cls
echo ======================================== echo ========================================
echo Industry Status / 产业运行状态 echo Industry Status
echo ======================================== echo ========================================
echo. echo.
call :CHECK_PORT 5150 "Cultural Tourism / 文旅产业" call :CHECK_PORT 5150 "Cultural Tourism"
call :CHECK_PORT 5151 "Smart Manufacturing / 智能制造" call :CHECK_PORT 5151 "Smart Manufacturing"
call :CHECK_PORT 5152 "Smart Development / 智能开发" call :CHECK_PORT 5152 "Smart Development"
call :CHECK_PORT 5153 "Finance Commerce / 财经商贸" call :CHECK_PORT 5153 "Finance Commerce"
call :CHECK_PORT 5154 "Visual Design / 视觉设计" call :CHECK_PORT 5154 "Visual Design"
call :CHECK_PORT 5155 "Transportation / 交通物流" call :CHECK_PORT 5155 "Transportation"
call :CHECK_PORT 5156 "Healthcare / 大健康" call :CHECK_PORT 5156 "Healthcare"
call :CHECK_PORT 5157 "Civil Engineering / 土木水利" call :CHECK_PORT 5157 "Civil Engineering"
call :CHECK_PORT 5158 "Food Industry / 食品产业" call :CHECK_PORT 5158 "Food Industry"
call :CHECK_PORT 5159 "Chemical Industry / 化工产业" call :CHECK_PORT 5159 "Chemical Industry"
call :CHECK_PORT 5160 "Energy Industry / 能源产业" call :CHECK_PORT 5160 "Energy Industry"
call :CHECK_PORT 5161 "Environmental / 环保产业" call :CHECK_PORT 5161 "Environmental"
echo. echo.
echo Press any key to continue... / 按任意键继续... echo Press any key to continue...
pause >nul pause >nul
goto MAIN_MENU goto MAIN_MENU
@@ -256,6 +252,6 @@ if %errorlevel%==0 (
exit /b 0 exit /b 0
:EXIT :EXIT
echo Goodbye! / 再见! echo Goodbye!
timeout /t 1 >nul timeout /t 1 >nul
exit exit