feat: 新增崗位描述與清單整合功能 v2.1

主要功能更新:
- 崗位描述保存功能:保存後資料寫入資料庫
- 崗位清單自動刷新:切換模組時自動載入最新資料
- 崗位清單檢視功能:點擊「檢視」按鈕載入對應描述
- 管理者頁面擴充:新增崗位資料管理與匯出功能
- CSV 批次匯入:支援崗位與職務資料批次匯入

後端 API 新增:
- Position Description CRUD APIs
- Position List Query & Export APIs
- CSV Template Download & Import APIs

文件更新:
- SDD.md 更新至版本 2.1
- README.md 更新功能說明與版本歷史

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-04 12:46:36 +08:00
parent d17af39bf4
commit b2584772c4
31 changed files with 6795 additions and 365 deletions

View File

@@ -26,7 +26,10 @@ except ImportError:
LLM_ENABLED = False
app = Flask(__name__, static_folder='.')
CORS(app)
# CORS 設定 - 限制允許的來源
cors_origins = os.getenv('CORS_ORIGINS', 'http://localhost:5000,http://127.0.0.1:5000').split(',')
CORS(app, origins=cors_origins)
# 模擬資料庫
positions_db = {}
@@ -262,11 +265,19 @@ def server_error(e):
# ==================== 主程式 ====================
if __name__ == '__main__':
# 從環境變數讀取設定,預設為安全值
host = os.getenv('FLASK_HOST', '127.0.0.1')
port = int(os.getenv('FLASK_PORT', 5000))
debug = os.getenv('FLASK_DEBUG', 'false').lower() == 'true'
print("=" * 60)
print("HR Position System - Flask Backend")
print("=" * 60)
print("\nServer starting...")
print("URL: http://localhost:5000")
print(f"\nServer starting...")
print(f"Host: {host}")
print(f"Port: {port}")
print(f"Debug: {debug}")
print(f"URL: http://{host}:{port}")
print()
if LLM_ENABLED:
@@ -283,4 +294,4 @@ if __name__ == '__main__':
print("=" * 60)
print()
app.run(host='0.0.0.0', port=5000, debug=True)
app.run(host=host, port=port, debug=debug)