@agent-xy/admin-vue3 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/index.js +1404 -0
  4. package/dist/style.css +1 -0
  5. package/dist/types/components/BaseCard/index.vue.d.ts +26 -0
  6. package/dist/types/components/DataTable/TableCell.vue.d.ts +14 -0
  7. package/dist/types/components/DataTable/index.vue.d.ts +53 -0
  8. package/dist/types/components/DataTable/types.d.ts +81 -0
  9. package/dist/types/components/Dialog/BaseDialog.vue.d.ts +141 -0
  10. package/dist/types/components/Dialog/index.d.ts +43 -0
  11. package/dist/types/components/Drawer/BaseDrawer.vue.d.ts +130 -0
  12. package/dist/types/components/Drawer/index.d.ts +1 -0
  13. package/dist/types/components/SearchForm/components/FormItem.vue.d.ts +35 -0
  14. package/dist/types/components/SearchForm/index.vue.d.ts +44 -0
  15. package/dist/types/components/SearchForm/types.d.ts +97 -0
  16. package/dist/types/components/SearchForm/values.d.ts +4 -0
  17. package/dist/types/hooks/useAsyncListAction.d.ts +7 -0
  18. package/dist/types/hooks/usePageList.d.ts +30 -0
  19. package/dist/types/hooks/useSelectOptions.d.ts +16 -0
  20. package/dist/types/index.d.ts +16 -0
  21. package/dist/types/types/admin.d.ts +3 -0
  22. package/dist/types/utils/adminCore.d.ts +74 -0
  23. package/dist/types/utils/data.d.ts +2 -0
  24. package/dist/types/utils/formRender.d.ts +2 -0
  25. package/dist/types/utils/tableRender.d.ts +7 -0
  26. package/docs/DataTable.md +23 -0
  27. package/docs/SearchForm.md +21 -0
  28. package/docs/usage.md +33 -0
  29. package/package.json +57 -4
  30. package/templates/manifest.json +82 -0
  31. package/templates/users/README.md +21 -0
  32. package/templates/users/api.ts +4 -0
  33. package/templates/users/components/AddExpireTime.vue +153 -0
  34. package/templates/users/components/MemberHistory.vue +33 -0
  35. package/templates/users/components/RenewalDiscount.vue +167 -0
  36. package/templates/users/config/columns.ts +45 -0
  37. package/templates/users/config/data.ts +22 -0
  38. package/templates/users/config/index.ts +3 -0
  39. package/templates/users/config/searchForm.ts +69 -0
  40. package/templates/users/constants.ts +22 -0
  41. package/templates/users/hooks/useRemoteResource.ts +34 -0
  42. package/templates/users/index.scss +41 -0
  43. package/templates/users/index.vue +273 -0
  44. package/templates/users/mock/index.ts +27 -0
  45. package/templates/users/mock/request.ts +32 -0
  46. package/templates/users/mock/store.ts +161 -0
  47. package/templates/users/types.ts +55 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AI Code contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,51 @@
1
- # Temporary Holding Version
1
+ # @agent-xy/admin-vue3
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Vue 3 后台公共组件,可独立于 `ai-code` 安装和使用。首批验证版本为 Vue 3.5.25、Element Plus 2.11.5,组件库和规则工具独立发布。
4
+
5
+ ```sh
6
+ npm install @agent-xy/admin-vue3
7
+ ```
8
+
9
+ 项目需要提供兼容的 Vue 与 Element Plus。声明精确版本或版本范围均可,按团队策略提交锁文件,在 CI 使用冻结锁文件安装;CLI 不固定组件版本。
10
+
11
+ ```vue
12
+ <template>
13
+ <DataTable row-key="id" :table-data="rows" :table-columns="columns" />
14
+ </template>
15
+ <script setup lang="ts">
16
+ import { DataTable, type TableColumn } from "@agent-xy/admin-vue3";
17
+ import "element-plus/dist/index.css";
18
+ import "@agent-xy/admin-vue3/style.css";
19
+ interface Row {
20
+ id: string;
21
+ name: string;
22
+ }
23
+ defineProps<{ rows: Row[] }>();
24
+ const columns: TableColumn<Row>[] = [{ prop: "name", label: "姓名" }];
25
+ </script>
26
+ ```
27
+
28
+ 公共导出包含 BaseCard、SearchForm、DataTable、BaseDialog、BaseDrawer、AdminDialog、createDialogService、Dialog、showDialog,三个列表组合式函数,以及配置辅助函数和相关类型。
29
+
30
+ - [搜索组件](docs/SearchForm.md)
31
+ - [表格组件](docs/DataTable.md)
32
+ - [弹层与列表逻辑](docs/usage.md)
33
+ - [用户管理页面接入](templates/users/README.md)
34
+
35
+ `AdminDialog` 是可选的 Vue 插件,提供全局函数式弹窗;声明式 BaseDialog 不需要安装插件。需要多个应用隔离时使用 `createDialogService(appContext)`。
36
+
37
+ 页面模板默认提供完整筛选、订阅操作和历史记录及可操作的本地演示数据,无须填写数据源。页面 API 入口在 `templates/users/api.ts`。页面模板跟随当前包版本分发,通过公开的 `templates/manifest.json` 入口发现。模板生成后归项目维护;用户自行注册路由、接入请求和权限。组件实现不复制到业务目录。
38
+
39
+ 开发维护在本仓库的 `packages/admin-vue3/src`,共享纯逻辑维护在 `content/templates/admin/shared/adminCore.ts`。旧复制资源由 `scripts/build-admin.mjs` 派生,不能反向修改。先构建组件包,再启动或构建示例;示例通过包导入消费构建产物,不使用源码别名。
40
+
41
+ ```sh
42
+ npm run build:admin
43
+ npm run dev --workspace @agent-xy/admin-vue3
44
+ npm run build:demo --workspace @agent-xy/admin-vue3
45
+ ```
46
+
47
+ 当前交付以本地打包验收,尚未公开发布,也没有配置线上演示地址。
48
+
49
+ 仓库根目录执行 `npm run pack:local`,再通过 `ai-code add components --package /path/to/artifacts/agent-xy-admin-vue3-0.1.0.tgz --template users --target src/views/users-v2` 使用本轮页面。默认命令复用已安装包;更新 CLI 或本仓库文件不会更新消费项目中的旧组件包,也不会覆盖已生成页面。
50
+
51
+ 组件与页面样式源码统一使用 SCSS,包的样式入口是编译后的 CSS。仅使用组件包无需 Sass;CLI 生成页面时补齐 `sass` 开发依赖,手动复制模板时请配置 Sass。