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
+132
View File
@@ -0,0 +1,132 @@
{
"base": {
"name": "Name",
"add": "Add",
"edit": "Edit",
"delete": "Delete",
"search": "Search",
"filter": "Filter",
"reset": "Reset",
"confirm": "Confirm",
"cancel": "Cancel",
"close": "Close",
"save": "Save",
"submit": "Submit",
"operation": "Operation",
"exportExcel": "Export Excel",
"importExcel": "Import Excel",
"success": "Success",
"fail": "Failed",
"noNavMenu": "No submenu",
"clearCache": "Clear Cache",
"logout": "Logout",
"netError": "Network error",
"disabled": "Disabled",
"enabled": "Enabled",
"pressEnter": "Press Enter to add",
"expand": "Expand",
"collapse": "Collapse"
},
"user": {
"username": "Username",
"password": "Password",
"nickname": "Nickname",
"roleId": "Role",
"active": "Active",
"createdAt": "Created At",
"updatedAt": "Updated At",
"menuManage": "User",
"operationLog": "Operation Log"
},
"operationLog": {
"ip": "IP",
"method": "Action",
"args": "Args",
"success": "Success",
"errorMsg": "Error",
"createdAt": "Time"
},
"role": {
"name": "Role Name",
"description": "Description",
"isSuperAdmin": "Super Admin",
"powers": "Permissions",
"createdAt": "Created At",
"updatedAt": "Updated At",
"menuManage": "Role",
"menuList": "Role List",
"empty": "No roles",
"addRole": "Add Role",
"confirmDelete": "Are you sure you want to delete this role?",
"selectOrCreate": "Please select or create a role",
"selectAll": "Select All",
"newRole": "New Role"
},
"table": {
"addSuccess": "Added successfully",
"editSuccess": "Updated successfully",
"confirmDelete": "Are you sure you want to delete this record?",
"confirmClear": "Are you sure you want to clear all data? This cannot be undone!",
"yes": "Yes",
"no": "No",
"unlimited": "Any",
"startTime": "Start Time",
"endTime": "End Time",
"min": "Min",
"max": "Max",
"justNow": "Just now",
"minutesAgo": "{n} min ago",
"hoursAgo": "{n} hr ago",
"daysAgo": "{n} days ago",
"textareaMultipleNotSupported": "Textarea does not support multiple selection",
"passwordMultipleNotSupported": "Password does not support multiple selection",
"pressEnterForNumber": "Type number and press Enter"
},
"login": {
"userPlaceholder": "Username / Phone / Email",
"PWPlaceholder": "Please enter password",
"signIn": "Sign In",
"userError": "Please enter username",
"PWError": "Please enter password"
},
"power": {
"user": "User",
"role": "Role",
"zerobase": "Zero Base",
"add": "Add",
"edit": "Edit",
"delete": "Delete",
"list": "List",
"get": "Detail",
"importExcel": "Import Excel",
"exportExcel": "Export Excel",
"view": "View",
"clear": "Clear",
"export": "Export",
"import": "Import"
},
"shrimp": {
"loginFailed": "Incorrect username or password",
"userNotFound": "User not found",
"relogin": "Please log in again",
"userDisabled": "User has been disabled",
"emptyPath": "Request path cannot be empty",
"forbidden": "Insufficient permissions",
"serverError": "Server error",
"cannotDisableSelf": "Cannot disable yourself",
"cannotDeleteSelf": "Cannot delete yourself",
"cannotChangeOwnRole": "Cannot change your own role",
"cannotEditOwnRole": "Cannot edit your own role",
"cannotDeleteOwnRole": "Cannot delete your own role",
"cannotClearAllUsers": "Cannot clear all users",
"cannotClearAllRoles": "Cannot clear all roles",
"fieldRequired": "Field \"{field}\" is required",
"fieldTypeError": "Field \"{field}\" has invalid type",
"fieldInvalid": "Field \"{field}\" has invalid value",
"fieldMin": "Field \"{field}\" minimum value is {min}",
"fieldMax": "Field \"{field}\" maximum value is {max}",
"fieldMinLength": "Field \"{field}\" minimum length is {min}",
"fieldMaxLength": "Field \"{field}\" maximum length is {max}",
"invalidJson": "Invalid JSON format"
}
}