feat: shrimp-admin v0.1.0 — 从 hand-admin 抽离的框架前端

Shrimp 框架前端 — 一种消费 ShrimpServer + ShrimpTable 契约的经典 Vue3 +
Element Plus 实现。不是框架本身,只是按 shrimp-server 约定写的一份参考解法。

包含:
- ShrimpClient + VueAdmin(factory:createShrimpAdmin)
- 5 个 Shrimp* 组件 + 10 个内置 Field*.vue + PowerTree + LangSwitch
- 4 个内置模块:user / role / operationLog / FieldRelativeTime
- 完整后台壳 views(layout/login/sideM/topbar/userbar/navMenu/App/404/logo)
- composables/useTableUrlSync, locales(zh-cn/en 框架默认), style 全套

API 改造:
- createShrimpAdmin({ config, moduleSources, customFields, locales }) factory
- vueAdmin 改为 Proxy 单例,createShrimpAdmin 调用前访问会抛错
- import.meta.glob 业务字段/模块由消费侧传入(vite 静态扫描机制限制)
- 框架默认 locales 与消费侧 locales 在 i18n 初始化时合并

源码 ship 不打包,消费侧靠 vite 直接吃 .ts/.vue。
This commit is contained in:
2026-05-23 21:01:33 +08:00
parent b4ee2e4b43
commit 4cb3bb8d75
50 changed files with 6551 additions and 0 deletions
+130
View File
@@ -0,0 +1,130 @@
{
"base": {
"name": "名称",
"add": "新增",
"edit": "编辑",
"delete": "删除",
"search": "搜索",
"filter": "筛选",
"reset": "重置",
"confirm": "确定",
"cancel": "取消",
"close": "关闭",
"save": "保存",
"submit": "提交",
"operation": "操作",
"exportExcel": "导出Excel",
"importExcel": "导入Excel",
"success": "成功",
"fail": "失败",
"noNavMenu": "没有子菜单",
"clearCache": "清除缓存",
"logout": "退出登录",
"netError": "网络出错",
"disabled": "禁用",
"enabled": "启用",
"pressEnter": "按回车添加",
"back": "返回",
"refresh": "刷新",
"notFound": "未找到数据",
"expand": "展开",
"collapse": "收起"
},
"user": {
"username": "用户名",
"password": "密码",
"nickname": "昵称",
"roleId": "角色",
"active": "启用状态",
"createdAt": "创建时间",
"updatedAt": "更新时间",
"operationLog": "操作日志"
},
"operationLog": {
"ip": "IP",
"method": "操作",
"args": "参数",
"success": "成功",
"errorMsg": "错误信息",
"createdAt": "时间"
},
"role": {
"name": "角色名",
"description": "描述",
"isSuperAdmin": "超级管理员",
"powers": "权限",
"createdAt": "创建时间",
"updatedAt": "更新时间",
"menuList": "角色列表",
"empty": "暂无角色",
"addRole": "新增角色",
"confirmDelete": "确定删除此角色吗?",
"selectOrCreate": "请选择或新建角色",
"selectAll": "全选",
"newRole": "新角色"
},
"table": {
"addSuccess": "新增成功",
"editSuccess": "编辑成功",
"confirmDelete": "确定删除此记录吗?",
"confirmClear": "确定清空数据吗?此操作不可恢复!",
"yes": "是",
"no": "否",
"unlimited": "不限",
"startTime": "开始时间",
"endTime": "结束时间",
"min": "最小值",
"max": "最大值",
"justNow": "刚刚",
"minutesAgo": "{n} 分钟前",
"hoursAgo": "{n} 小时前",
"daysAgo": "{n} 天前",
"textareaMultipleNotSupported": "文本域暂不支持多选",
"passwordMultipleNotSupported": "密码暂不支持多选",
"pressEnterForNumber": "输入数字后按回车"
},
"login": {
"userPlaceholder": "用户名 / 手机 / 邮箱",
"PWPlaceholder": "请输入密码",
"signIn": "登录",
"userError": "请输入用户名",
"PWError": "请输入密码"
},
"power": {
"add": "新增",
"edit": "编辑",
"delete": "删除",
"list": "列表",
"get": "详情",
"importExcel": "导入Excel",
"exportExcel": "导出Excel",
"view": "查看",
"clear": "清除",
"export": "导出",
"import": "导入"
},
"shrimp": {
"loginFailed": "用户名或密码错误",
"userNotFound": "用户不存在",
"relogin": "请重新登录",
"userDisabled": "用户已被禁用",
"emptyPath": "请求路径不能为空",
"forbidden": "权限不足",
"serverError": "服务器错误",
"cannotDisableSelf": "不能禁用自己",
"cannotDeleteSelf": "不能删除自己",
"cannotChangeOwnRole": "不能修改自己的角色",
"cannotEditOwnRole": "不能编辑自己的角色",
"cannotDeleteOwnRole": "不能删除自己的角色",
"cannotClearAllUsers": "不能清空所有用户",
"cannotClearAllRoles": "不能清空所有角色",
"fieldRequired": "字段\"{field}\"不能为空",
"fieldTypeError": "字段\"{field}\"类型错误",
"fieldInvalid": "字段\"{field}\"值不合法",
"fieldMin": "字段\"{field}\"最小值为 {min}",
"fieldMax": "字段\"{field}\"最大值为 {max}",
"fieldMinLength": "字段\"{field}\"最小长度为 {min}",
"fieldMaxLength": "字段\"{field}\"最大长度为 {max}",
"invalidJson": "JSON格式错误"
}
}