feat(platform): 部署配置向导 + 地图管理,地图编辑器接入统一存取与 AI 助手

- 配置向导:登录按 deployment 画像引导平台选型(导航方式/模块/场景),未完成则路由守卫强制进入 /wizard;选型驱动菜单按需裁剪,并联动 SimpleLite 写 plugins/active-scenes.json + 透传 --scenes 选择性加载导航场景插件
- 地图管理页:服务器地图列表/使用/重命名/删除、地图合并、多地图连接管理
- 地图编辑器:项目存取改为存入地图管理统一目录(同名替换确认),支持 ?map=/?new= 进入,新增右侧可停靠 AI 助手面板
- 集成 PTL 拣选模块;新增车队分配面板(运维总览/筛选联动)
- SimpleLiteBuildSync 同步运行时依赖 DLL;重新构建前端静态资源

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zhaowei.huang
2026-06-03 09:37:07 +08:00
co-authored by Cursor
parent e2269e430d
commit 7382e85598
109 changed files with 3481 additions and 398 deletions
@@ -19,6 +19,8 @@ interface AuthState {
* 在用户离开期间重启(JWT secret 重生)的场景下能立刻被发现并跳登录。
*/
validated: boolean
/** 部署配置向导是否待完成(来自登录/me 响应;仅内存态,刷新后由 validate 重新拉取)。 */
needsWizard: boolean
}
const TOKEN_KEY = 'simple.auth.token'
@@ -49,7 +51,9 @@ function loadState(): AuthState {
runMode: safeReadString(RUN_MODE_KEY) as RunMode | null,
effectivePermissions: safeJsonParse<EffectivePermissions>(PERM_KEY),
// 刷新页面后默认未校验:路由守卫会在受保护路由首次进入前 await validate()。
validated: false
validated: false,
// 部署向导状态不持久化:刷新后默认 false,validate() 用后端最新值回填,避免误拦。
needsWizard: false
}
}
@@ -61,6 +65,7 @@ function clearLocalAuth(target: AuthState) {
target.runMode = null
target.effectivePermissions = null
target.validated = false
target.needsWizard = false
try {
localStorage.removeItem(TOKEN_KEY)
localStorage.removeItem(USER_KEY)
@@ -105,6 +110,7 @@ export const useAuthStore = defineStore('auth', {
this.scope = resp.scope
this.runMode = resp.runMode
this.effectivePermissions = resp.effectivePermissions
this.needsWizard = resp.needsWizard ?? false
// 登录响应本身就是后端的身份背书,等同于一次成功的 /me;省一次往返。
this.validated = true
localStorage.setItem(TOKEN_KEY, resp.token)
@@ -136,6 +142,7 @@ export const useAuthStore = defineStore('auth', {
this.scope = me.scope
this.runMode = me.runMode
this.effectivePermissions = me.effectivePermissions
this.needsWizard = me.needsWizard ?? false
this.validated = true
localStorage.setItem(USER_KEY, JSON.stringify(me.user))
localStorage.setItem(SCOPE_KEY, me.scope)
@@ -161,6 +168,7 @@ export const useAuthStore = defineStore('auth', {
this.scope = resp.scope
this.runMode = resp.runMode
this.effectivePermissions = resp.effectivePermissions
this.needsWizard = resp.needsWizard ?? false
// SwitchScope 后端重发了 token + perm,等同于一次成功的 /me,保持 validated 为 true。
this.validated = true
localStorage.setItem(TOKEN_KEY, resp.token)
@@ -169,6 +177,10 @@ export const useAuthStore = defineStore('auth', {
localStorage.setItem(RUN_MODE_KEY, resp.runMode)
localStorage.setItem(PERM_KEY, JSON.stringify(resp.effectivePermissions))
return resp
},
/** 向导保存成功后调用:清掉 needsWizard,避免守卫再次把用户导回 /wizard。 */
markWizardDone() {
this.needsWizard = false
}
}
})