openxiangda-cli 2.0.0-alpha.12 → 2.0.0-alpha.122

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 (271) hide show
  1. package/README.md +13 -14
  2. package/bin/run.js +79 -1
  3. package/dist/base.d.ts +40 -5
  4. package/dist/base.d.ts.map +1 -1
  5. package/dist/base.js +123 -10
  6. package/dist/base.js.map +1 -1
  7. package/dist/commands/accept.d.ts +25 -0
  8. package/dist/commands/accept.d.ts.map +1 -0
  9. package/dist/commands/accept.js +21 -0
  10. package/dist/commands/accept.js.map +1 -0
  11. package/dist/commands/cancel.d.ts +16 -1
  12. package/dist/commands/cancel.d.ts.map +1 -1
  13. package/dist/commands/cancel.js +1 -1
  14. package/dist/commands/cancel.js.map +1 -1
  15. package/dist/commands/check.d.ts +17 -1
  16. package/dist/commands/check.d.ts.map +1 -1
  17. package/dist/commands/check.js +15 -3
  18. package/dist/commands/check.js.map +1 -1
  19. package/dist/commands/create.d.ts +25 -0
  20. package/dist/commands/create.d.ts.map +1 -0
  21. package/dist/commands/create.js +101 -0
  22. package/dist/commands/create.js.map +1 -0
  23. package/dist/commands/deploy.d.ts +21 -8
  24. package/dist/commands/deploy.d.ts.map +1 -1
  25. package/dist/commands/deploy.js +29 -16
  26. package/dist/commands/deploy.js.map +1 -1
  27. package/dist/commands/dev.d.ts +18 -1
  28. package/dist/commands/dev.d.ts.map +1 -1
  29. package/dist/commands/dev.js +24 -3
  30. package/dist/commands/dev.js.map +1 -1
  31. package/dist/commands/login.d.ts +26 -0
  32. package/dist/commands/login.d.ts.map +1 -0
  33. package/dist/commands/login.js +73 -0
  34. package/dist/commands/login.js.map +1 -0
  35. package/dist/commands/logs.d.ts +17 -2
  36. package/dist/commands/logs.d.ts.map +1 -1
  37. package/dist/commands/logs.js +2 -2
  38. package/dist/commands/logs.js.map +1 -1
  39. package/dist/commands/retry.d.ts +16 -1
  40. package/dist/commands/retry.d.ts.map +1 -1
  41. package/dist/commands/retry.js +5 -2
  42. package/dist/commands/retry.js.map +1 -1
  43. package/dist/commands/rollback.d.ts +17 -4
  44. package/dist/commands/rollback.d.ts.map +1 -1
  45. package/dist/commands/rollback.js +11 -4
  46. package/dist/commands/rollback.js.map +1 -1
  47. package/dist/commands/skill.d.ts +28 -0
  48. package/dist/commands/skill.d.ts.map +1 -0
  49. package/dist/commands/skill.js +43 -0
  50. package/dist/commands/skill.js.map +1 -0
  51. package/dist/commands/spec.d.ts +36 -0
  52. package/dist/commands/spec.d.ts.map +1 -0
  53. package/dist/commands/spec.js +117 -0
  54. package/dist/commands/spec.js.map +1 -0
  55. package/dist/commands/start.d.ts +25 -0
  56. package/dist/commands/start.d.ts.map +1 -0
  57. package/dist/commands/start.js +18 -0
  58. package/dist/commands/start.js.map +1 -0
  59. package/dist/commands/status.d.ts +16 -1
  60. package/dist/commands/status.d.ts.map +1 -1
  61. package/dist/commands/status.js +1 -1
  62. package/dist/commands/status.js.map +1 -1
  63. package/dist/commands/stop.d.ts +25 -0
  64. package/dist/commands/stop.d.ts.map +1 -0
  65. package/dist/commands/stop.js +18 -0
  66. package/dist/commands/stop.js.map +1 -0
  67. package/dist/create-workspace.d.ts +31 -0
  68. package/dist/create-workspace.d.ts.map +1 -0
  69. package/dist/create-workspace.js +273 -0
  70. package/dist/create-workspace.js.map +1 -0
  71. package/dist/toolchain-capsule.d.ts +4 -0
  72. package/dist/toolchain-capsule.d.ts.map +1 -0
  73. package/dist/toolchain-capsule.js +116 -0
  74. package/dist/toolchain-capsule.js.map +1 -0
  75. package/package.json +16 -9
  76. package/template/.dockerignore +23 -0
  77. package/template/.env.example +3 -0
  78. package/template/AGENTS.md +25 -0
  79. package/template/README.md +43 -0
  80. package/template/_gitignore +14 -0
  81. package/template/apps/server/Dockerfile +20 -0
  82. package/template/apps/server/package.json +27 -0
  83. package/template/apps/server/src/app.module.ts +43 -0
  84. package/template/apps/server/src/main.ts +5 -0
  85. package/template/apps/server/test/smoke.test.ts +16 -0
  86. package/template/apps/server/tsconfig.json +9 -0
  87. package/template/apps/web/data-api-live.e2e.html +15 -0
  88. package/template/apps/web/e2e/client-fixture.ts +5 -0
  89. package/template/apps/web/e2e/data-api-live-fixture.tsx +162 -0
  90. package/template/apps/web/e2e/data-api-live.spec.ts +144 -0
  91. package/template/apps/web/e2e/field-protocol-fixture.tsx +347 -0
  92. package/template/apps/web/e2e/field-protocol.spec.ts +195 -0
  93. package/template/apps/web/e2e/resource-experience-fixture.tsx +415 -0
  94. package/template/apps/web/e2e/resources.spec.ts +578 -0
  95. package/template/apps/web/e2e/workflow-experience-fixture.tsx +144 -0
  96. package/template/apps/web/e2e/workflow.spec.ts +576 -0
  97. package/template/apps/web/field-protocol.e2e.html +15 -0
  98. package/template/apps/web/index.html +12 -0
  99. package/template/apps/web/package.json +32 -0
  100. package/template/apps/web/playwright.config.ts +47 -0
  101. package/template/apps/web/resource-experience.e2e.html +15 -0
  102. package/template/apps/web/scripts/check.mjs +43 -0
  103. package/template/apps/web/scripts/verify-build.mjs +6 -0
  104. package/template/apps/web/src/main.tsx +41 -0
  105. package/template/apps/web/test/contracts.test.ts +149 -0
  106. package/template/apps/web/test/loopback.test.ts +62 -0
  107. package/template/apps/web/tsconfig.json +12 -0
  108. package/template/apps/web/vite.config.ts +40 -0
  109. package/template/apps/web/workflow-experience.e2e.html +15 -0
  110. package/template/appspec/app.md +36 -0
  111. package/template/openxiangda.config.ts +34 -0
  112. package/template/package.json +28 -0
  113. package/template/packages/contracts/package.json +23 -0
  114. package/template/packages/contracts/src/generated.ts +135 -0
  115. package/template/packages/contracts/src/index.ts +1 -0
  116. package/template/packages/contracts/tsconfig.json +9 -0
  117. package/template/pnpm-workspace.yaml +7 -0
  118. package/template/scripts/verify-template-budget.mjs +49 -0
  119. package/template/tsconfig.base.json +13 -0
  120. package/dist/commands/app/create.d.ts +0 -15
  121. package/dist/commands/app/create.d.ts.map +0 -1
  122. package/dist/commands/app/create.js +0 -42
  123. package/dist/commands/app/create.js.map +0 -1
  124. package/dist/commands/app/info.d.ts +0 -9
  125. package/dist/commands/app/info.d.ts.map +0 -1
  126. package/dist/commands/app/info.js +0 -10
  127. package/dist/commands/app/info.js.map +0 -1
  128. package/dist/commands/app/link.d.ts +0 -10
  129. package/dist/commands/app/link.d.ts.map +0 -1
  130. package/dist/commands/app/link.js +0 -16
  131. package/dist/commands/app/link.js.map +0 -1
  132. package/dist/commands/app/provision.d.ts +0 -9
  133. package/dist/commands/app/provision.d.ts.map +0 -1
  134. package/dist/commands/app/provision.js +0 -10
  135. package/dist/commands/app/provision.js.map +0 -1
  136. package/dist/commands/auth/login.d.ts +0 -10
  137. package/dist/commands/auth/login.d.ts.map +0 -1
  138. package/dist/commands/auth/login.js +0 -34
  139. package/dist/commands/auth/login.js.map +0 -1
  140. package/dist/commands/auth/logout.d.ts +0 -6
  141. package/dist/commands/auth/logout.d.ts.map +0 -1
  142. package/dist/commands/auth/logout.js +0 -10
  143. package/dist/commands/auth/logout.js.map +0 -1
  144. package/dist/commands/auth/status.d.ts +0 -6
  145. package/dist/commands/auth/status.d.ts.map +0 -1
  146. package/dist/commands/auth/status.js +0 -19
  147. package/dist/commands/auth/status.js.map +0 -1
  148. package/dist/commands/build.d.ts +0 -11
  149. package/dist/commands/build.d.ts.map +0 -1
  150. package/dist/commands/build.js +0 -23
  151. package/dist/commands/build.js.map +0 -1
  152. package/dist/commands/doctor.d.ts +0 -9
  153. package/dist/commands/doctor.d.ts.map +0 -1
  154. package/dist/commands/doctor.js +0 -7
  155. package/dist/commands/doctor.js.map +0 -1
  156. package/dist/commands/event/delivery/list.d.ts +0 -10
  157. package/dist/commands/event/delivery/list.d.ts.map +0 -1
  158. package/dist/commands/event/delivery/list.js +0 -14
  159. package/dist/commands/event/delivery/list.js.map +0 -1
  160. package/dist/commands/event/delivery/replay.d.ts +0 -13
  161. package/dist/commands/event/delivery/replay.d.ts.map +0 -1
  162. package/dist/commands/event/delivery/replay.js +0 -16
  163. package/dist/commands/event/delivery/replay.js.map +0 -1
  164. package/dist/commands/event/subscription/list.d.ts +0 -9
  165. package/dist/commands/event/subscription/list.d.ts.map +0 -1
  166. package/dist/commands/event/subscription/list.js +0 -10
  167. package/dist/commands/event/subscription/list.js.map +0 -1
  168. package/dist/commands/event/subscription/rotate-secret.d.ts +0 -15
  169. package/dist/commands/event/subscription/rotate-secret.d.ts.map +0 -1
  170. package/dist/commands/event/subscription/rotate-secret.js +0 -33
  171. package/dist/commands/event/subscription/rotate-secret.js.map +0 -1
  172. package/dist/commands/event/subscription/status.d.ts +0 -14
  173. package/dist/commands/event/subscription/status.d.ts.map +0 -1
  174. package/dist/commands/event/subscription/status.js +0 -19
  175. package/dist/commands/event/subscription/status.js.map +0 -1
  176. package/dist/commands/event/timer/list.d.ts +0 -9
  177. package/dist/commands/event/timer/list.d.ts.map +0 -1
  178. package/dist/commands/event/timer/list.js +0 -10
  179. package/dist/commands/event/timer/list.js.map +0 -1
  180. package/dist/commands/event/timer/status.d.ts +0 -14
  181. package/dist/commands/event/timer/status.d.ts.map +0 -1
  182. package/dist/commands/event/timer/status.js +0 -19
  183. package/dist/commands/event/timer/status.js.map +0 -1
  184. package/dist/commands/generate.d.ts +0 -10
  185. package/dist/commands/generate.d.ts.map +0 -1
  186. package/dist/commands/generate.js +0 -8
  187. package/dist/commands/generate.js.map +0 -1
  188. package/dist/commands/oauth/audit/list.d.ts +0 -12
  189. package/dist/commands/oauth/audit/list.d.ts.map +0 -1
  190. package/dist/commands/oauth/audit/list.js +0 -20
  191. package/dist/commands/oauth/audit/list.js.map +0 -1
  192. package/dist/commands/oauth/client/create.d.ts +0 -13
  193. package/dist/commands/oauth/client/create.d.ts.map +0 -1
  194. package/dist/commands/oauth/client/create.js +0 -34
  195. package/dist/commands/oauth/client/create.js.map +0 -1
  196. package/dist/commands/oauth/client/list.d.ts +0 -9
  197. package/dist/commands/oauth/client/list.d.ts.map +0 -1
  198. package/dist/commands/oauth/client/list.js +0 -10
  199. package/dist/commands/oauth/client/list.js.map +0 -1
  200. package/dist/commands/oauth/client/revoke.d.ts +0 -12
  201. package/dist/commands/oauth/client/revoke.d.ts.map +0 -1
  202. package/dist/commands/oauth/client/revoke.js +0 -12
  203. package/dist/commands/oauth/client/revoke.js.map +0 -1
  204. package/dist/commands/oauth/client/rotate.d.ts +0 -13
  205. package/dist/commands/oauth/client/rotate.d.ts.map +0 -1
  206. package/dist/commands/oauth/client/rotate.js +0 -20
  207. package/dist/commands/oauth/client/rotate.js.map +0 -1
  208. package/dist/commands/oauth/client/update.d.ts +0 -15
  209. package/dist/commands/oauth/client/update.d.ts.map +0 -1
  210. package/dist/commands/oauth/client/update.js +0 -23
  211. package/dist/commands/oauth/client/update.js.map +0 -1
  212. package/dist/commands/oauth/runtime/rotate.d.ts +0 -12
  213. package/dist/commands/oauth/runtime/rotate.d.ts.map +0 -1
  214. package/dist/commands/oauth/runtime/rotate.js +0 -31
  215. package/dist/commands/oauth/runtime/rotate.js.map +0 -1
  216. package/dist/commands/oauth/runtime/status.d.ts +0 -10
  217. package/dist/commands/oauth/runtime/status.d.ts.map +0 -1
  218. package/dist/commands/oauth/runtime/status.js +0 -17
  219. package/dist/commands/oauth/runtime/status.js.map +0 -1
  220. package/dist/commands/promote.d.ts +0 -13
  221. package/dist/commands/promote.d.ts.map +0 -1
  222. package/dist/commands/promote.js +0 -9
  223. package/dist/commands/promote.js.map +0 -1
  224. package/dist/commands/secret/audit/list.d.ts +0 -14
  225. package/dist/commands/secret/audit/list.d.ts.map +0 -1
  226. package/dist/commands/secret/audit/list.js +0 -16
  227. package/dist/commands/secret/audit/list.js.map +0 -1
  228. package/dist/commands/secret/create.d.ts +0 -18
  229. package/dist/commands/secret/create.d.ts.map +0 -1
  230. package/dist/commands/secret/create.js +0 -33
  231. package/dist/commands/secret/create.js.map +0 -1
  232. package/dist/commands/secret/delete.d.ts +0 -15
  233. package/dist/commands/secret/delete.d.ts.map +0 -1
  234. package/dist/commands/secret/delete.js +0 -20
  235. package/dist/commands/secret/delete.js.map +0 -1
  236. package/dist/commands/secret/list.d.ts +0 -10
  237. package/dist/commands/secret/list.d.ts.map +0 -1
  238. package/dist/commands/secret/list.js +0 -14
  239. package/dist/commands/secret/list.js.map +0 -1
  240. package/dist/commands/secret/rotate.d.ts +0 -18
  241. package/dist/commands/secret/rotate.d.ts.map +0 -1
  242. package/dist/commands/secret/rotate.js +0 -30
  243. package/dist/commands/secret/rotate.js.map +0 -1
  244. package/dist/commands/secret/update.d.ts +0 -17
  245. package/dist/commands/secret/update.d.ts.map +0 -1
  246. package/dist/commands/secret/update.js +0 -37
  247. package/dist/commands/secret/update.js.map +0 -1
  248. package/dist/commands/skill/install.d.ts +0 -11
  249. package/dist/commands/skill/install.d.ts.map +0 -1
  250. package/dist/commands/skill/install.js +0 -52
  251. package/dist/commands/skill/install.js.map +0 -1
  252. package/dist/commands/skill/validate.d.ts +0 -9
  253. package/dist/commands/skill/validate.d.ts.map +0 -1
  254. package/dist/commands/skill/validate.js +0 -32
  255. package/dist/commands/skill/validate.js.map +0 -1
  256. package/dist/commands/test.d.ts +0 -9
  257. package/dist/commands/test.d.ts.map +0 -1
  258. package/dist/commands/test.js +0 -7
  259. package/dist/commands/test.js.map +0 -1
  260. package/dist/commands/workflow/provider/list.d.ts +0 -10
  261. package/dist/commands/workflow/provider/list.d.ts.map +0 -1
  262. package/dist/commands/workflow/provider/list.js +0 -14
  263. package/dist/commands/workflow/provider/list.js.map +0 -1
  264. package/dist/commands/workflow/provider/rotate.d.ts +0 -15
  265. package/dist/commands/workflow/provider/rotate.d.ts.map +0 -1
  266. package/dist/commands/workflow/provider/rotate.js +0 -24
  267. package/dist/commands/workflow/provider/rotate.js.map +0 -1
  268. package/dist/secret-value.d.ts +0 -5
  269. package/dist/secret-value.d.ts.map +0 -1
  270. package/dist/secret-value.js +0 -15
  271. package/dist/secret-value.js.map +0 -1
@@ -0,0 +1,415 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import { Button, Typography } from 'antd';
4
+ import {
5
+ defineApplicationContributions,
6
+ OpenXiangdaApplication,
7
+ } from 'openxiangda/react';
8
+ import type { DataFieldSurface, DataResourceSurface } from 'openxiangda/core';
9
+ import 'openxiangda/react/styles.css';
10
+
11
+ const field = (
12
+ label: string,
13
+ type: DataFieldSurface['type'] = 'text.short',
14
+ widget: DataFieldSurface['widget'] = 'text',
15
+ extra: Partial<DataFieldSurface> = {}
16
+ ): DataFieldSurface => ({
17
+ label,
18
+ type,
19
+ widget,
20
+ readCapabilities: [],
21
+ createCapabilities: [],
22
+ updateCapabilities: [],
23
+ ...extra,
24
+ });
25
+
26
+ const fields: DataResourceSurface['fields'] = {
27
+ departmentMultiple: field('构成部门', 'department.multiple', 'directory-department', {
28
+ list: true,
29
+ section: '组织信息',
30
+ }),
31
+ departmentSingle: field('牵头部门', 'department.single', 'directory-department', {
32
+ list: true,
33
+ section: '组织信息',
34
+ }),
35
+ userMultiple: field('小组成员', 'user.multiple', 'directory-user', {
36
+ list: true,
37
+ section: '组织信息',
38
+ }),
39
+ resourceMultiple: field('关联资源', 'resource-ref.multiple', 'resource', {
40
+ list: true,
41
+ section: '组织信息',
42
+ source: {
43
+ kind: 'resource',
44
+ resourceCode: 'resource-01',
45
+ labelField: 'name',
46
+ searchFields: ['name'],
47
+ },
48
+ }),
49
+ enabled: field('启用状态', 'boolean', 'switch', {
50
+ list: true,
51
+ section: '组织信息',
52
+ }),
53
+ displayOrder: field('显示顺序', 'number.integer', 'number', {
54
+ list: true,
55
+ section: '组织信息',
56
+ }),
57
+ description: field('栏目说明', 'text.long', 'textarea', {
58
+ section: '栏目设置',
59
+ }),
60
+ status: field('状态', 'option.single', 'select', {
61
+ options: [
62
+ { label: '启用', value: 'enabled' },
63
+ { label: '停用', value: 'disabled' },
64
+ ],
65
+ section: '栏目设置',
66
+ }),
67
+ name: field('栏目名称', 'text.short', 'text', { section: '栏目设置' }),
68
+ code: field('栏目编码', 'text.short', 'text', { section: '栏目设置' }),
69
+ contentType: field('内容类型', 'option.single', 'select', {
70
+ options: [
71
+ { label: '文章', value: 'article' },
72
+ { label: '图集', value: 'gallery' },
73
+ ],
74
+ section: '栏目设置',
75
+ }),
76
+ manager: field('栏目管理员', 'user.single', 'directory-user', {
77
+ section: '管理信息',
78
+ }),
79
+ facility: field('配套设施', 'option.multiple', 'multi-select', {
80
+ options: [
81
+ { label: '投影仪', value: 'projector' },
82
+ { label: '白板', value: 'whiteboard' },
83
+ ],
84
+ section: '管理信息',
85
+ }),
86
+ openingDay: field('开放星期', 'option.single', 'select', {
87
+ options: [
88
+ { label: '工作日', value: 'weekday' },
89
+ { label: '周末', value: 'weekend' },
90
+ ],
91
+ section: '管理信息',
92
+ }),
93
+ };
94
+
95
+ const surface: DataResourceSurface = {
96
+ mutationOwner: 'native',
97
+ generated: {
98
+ list: true,
99
+ detail: true,
100
+ create: true,
101
+ update: true,
102
+ delete: true,
103
+ },
104
+ fields,
105
+ list: {
106
+ defaultPageSize: 20,
107
+ searchableFields: ['name', 'code'],
108
+ filterFields: ['contentType', 'status', 'manager', 'facility', 'openingDay'],
109
+ defaultSort: { field: 'code', order: 'asc' },
110
+ },
111
+ form: {
112
+ layout: 'sections',
113
+ fieldOrder: [
114
+ 'code',
115
+ 'name',
116
+ 'contentType',
117
+ 'description',
118
+ 'status',
119
+ 'manager',
120
+ 'facility',
121
+ 'openingDay',
122
+ ],
123
+ },
124
+ detail: {
125
+ layout: 'sections',
126
+ fieldOrder: [
127
+ 'code',
128
+ 'name',
129
+ 'contentType',
130
+ 'description',
131
+ 'status',
132
+ 'manager',
133
+ 'facility',
134
+ 'openingDay',
135
+ ],
136
+ },
137
+ mobile: { enabled: true },
138
+ };
139
+
140
+ const { enabled, displayOrder, ...remainingFields } = fields;
141
+ const acceptanceSurface = new URLSearchParams(location.search).get('primary') === 'falsy'
142
+ ? { ...surface, fields: { enabled, displayOrder, ...remainingFields } }
143
+ : surface;
144
+
145
+ const names = [
146
+ '内容栏目',
147
+ '内容文章',
148
+ '内容专题',
149
+ '会员档案',
150
+ '门户轮播',
151
+ '工会小组',
152
+ '场地预约',
153
+ '场地不可用时段',
154
+ '场地档案',
155
+ '通知公告',
156
+ '活动报名',
157
+ '资料下载',
158
+ ];
159
+ const resourceDefinitions = Object.fromEntries(
160
+ names.map((name, index) => {
161
+ const code = `resource-${String(index + 1).padStart(2, '0')}`;
162
+ return [
163
+ code,
164
+ {
165
+ code,
166
+ name,
167
+ capabilities: {
168
+ read: `app:openxiangda-application:data:${code}:read`,
169
+ create: `app:openxiangda-application:data:${code}:create`,
170
+ update: `app:openxiangda-application:data:${code}:update`,
171
+ delete: `app:openxiangda-application:data:${code}:delete`,
172
+ },
173
+ surface: acceptanceSurface,
174
+ },
175
+ ];
176
+ })
177
+ );
178
+
179
+ function ContentOperationsPage() {
180
+ return <Typography.Title level={2}>内容业务操作</Typography.Title>;
181
+ }
182
+
183
+ function ResourcePortalPage() {
184
+ return <Typography.Title level={2}>用户端内容门户</Typography.Title>;
185
+ }
186
+
187
+ const applicationContributions = defineApplicationContributions(
188
+ {
189
+ contentOperations: {
190
+ code: 'content-operations',
191
+ path: '/admin/operations/content',
192
+ label: '内容业务操作',
193
+ surface: 'admin',
194
+ capability: 'app:openxiangda-application:operations:read',
195
+ tabPersistence: 'session',
196
+ keepAlive: 'none',
197
+ },
198
+ resourcePortal: {
199
+ code: 'resource-portal',
200
+ path: '/resource-01',
201
+ label: '用户端内容门户',
202
+ surface: 'user',
203
+ tabPersistence: 'session',
204
+ keepAlive: 'none',
205
+ },
206
+ } as const,
207
+ {
208
+ pages: {
209
+ contentOperations: ContentOperationsPage,
210
+ resourcePortal: ResourcePortalPage,
211
+ },
212
+ resources: {
213
+ 'resource-01': {
214
+ toolbar: [
215
+ {
216
+ code: 'publish-selected',
217
+ label: '发布选中栏目',
218
+ capability: 'app:openxiangda-application:operations:read',
219
+ render: ({ selectedRecords }) => (
220
+ <Button>发布选中栏目({selectedRecords.length})</Button>
221
+ ),
222
+ },
223
+ ],
224
+ },
225
+ },
226
+ },
227
+ );
228
+
229
+ if (location.pathname.endsWith('/resource-experience.e2e.html')) {
230
+ history.replaceState({}, '', '/admin/resources/resource-01');
231
+ }
232
+
233
+ ReactDOM.createRoot(document.getElementById('root')!).render(
234
+ <React.StrictMode>
235
+ <OpenXiangdaApplication
236
+ appCode="openxiangda-application"
237
+ appName="资源体验验收"
238
+ adminNavigation={[
239
+ {
240
+ code: 'resources',
241
+ label: '数据管理',
242
+ icon: 'database',
243
+ order: 0,
244
+ items: [
245
+ { pageCode: 'resource:resource-01:list', label: '内容栏目', order: 0 },
246
+ { pageCode: 'resource:resource-02:list', label: '内容文章', order: 1 },
247
+ { pageCode: 'resource:resource-03:list', label: '内容专题', order: 2 },
248
+ { pageCode: 'resource:resource-04:list', label: '会员档案', order: 3 },
249
+ { pageCode: 'resource:resource-05:list', label: '门户轮播', order: 4 },
250
+ { pageCode: 'resource:resource-06:list', label: '工会小组', order: 5 },
251
+ { pageCode: 'resource:resource-07:list', label: '场地预约', order: 6 },
252
+ {
253
+ pageCode: 'resource:resource-08:list',
254
+ label: '场地不可用时段',
255
+ order: 7,
256
+ },
257
+ { pageCode: 'resource:resource-09:list', label: '场地档案', order: 8 },
258
+ { pageCode: 'resource:resource-10:list', label: '通知公告', order: 9 },
259
+ { pageCode: 'resource:resource-11:list', label: '活动报名', order: 10 },
260
+ { pageCode: 'resource:resource-12:list', label: '资料下载', order: 11 },
261
+ { pageCode: 'operation:content-operations', order: 12 },
262
+ ],
263
+ },
264
+ ]}
265
+ adminPages={[
266
+ {
267
+ code: 'resource:resource-01:list',
268
+ kind: 'resource-list',
269
+ path: '/admin/resources/resource-01',
270
+ label: '资源 01',
271
+ navigationEligible: true,
272
+ capability: resourceDefinitions['resource-01'].capabilities.read,
273
+ resourceCode: 'resource-01',
274
+ },
275
+ {
276
+ code: 'resource:resource-01:detail',
277
+ kind: 'resource-detail',
278
+ path: '/admin/resources/resource-01/:id',
279
+ label: '资源 01 详情',
280
+ navigationEligible: false,
281
+ capability: resourceDefinitions['resource-01'].capabilities.read,
282
+ resourceCode: 'resource-01',
283
+ },
284
+ {
285
+ code: 'resource:resource-01:create',
286
+ kind: 'resource-create',
287
+ path: '/admin/resources/resource-01/new',
288
+ label: '新增资源 01',
289
+ navigationEligible: false,
290
+ capability: resourceDefinitions['resource-01'].capabilities.create,
291
+ resourceCode: 'resource-01',
292
+ },
293
+ {
294
+ code: 'resource:resource-01:update',
295
+ kind: 'resource-update',
296
+ path: '/admin/resources/resource-01/:id/edit',
297
+ label: '编辑资源 01',
298
+ navigationEligible: false,
299
+ capability: resourceDefinitions['resource-01'].capabilities.update,
300
+ resourceCode: 'resource-01',
301
+ },
302
+ {
303
+ code: 'resource:resource-02:list',
304
+ kind: 'resource-list',
305
+ path: '/admin/resources/resource-02',
306
+ label: '内容文章',
307
+ navigationEligible: true,
308
+ capability: resourceDefinitions['resource-02'].capabilities.read,
309
+ resourceCode: 'resource-02',
310
+ },
311
+ {
312
+ code: 'resource:resource-03:list',
313
+ kind: 'resource-list',
314
+ path: '/admin/resources/resource-03',
315
+ label: '内容专题',
316
+ navigationEligible: true,
317
+ capability: resourceDefinitions['resource-03'].capabilities.read,
318
+ resourceCode: 'resource-03',
319
+ },
320
+ {
321
+ code: 'resource:resource-04:list',
322
+ kind: 'resource-list',
323
+ path: '/admin/resources/resource-04',
324
+ label: '会员档案',
325
+ navigationEligible: true,
326
+ capability: resourceDefinitions['resource-04'].capabilities.read,
327
+ resourceCode: 'resource-04',
328
+ },
329
+ {
330
+ code: 'resource:resource-05:list',
331
+ kind: 'resource-list',
332
+ path: '/admin/resources/resource-05',
333
+ label: '门户轮播',
334
+ navigationEligible: true,
335
+ capability: resourceDefinitions['resource-05'].capabilities.read,
336
+ resourceCode: 'resource-05',
337
+ },
338
+ {
339
+ code: 'resource:resource-06:list',
340
+ kind: 'resource-list',
341
+ path: '/admin/resources/resource-06',
342
+ label: '工会小组',
343
+ navigationEligible: true,
344
+ capability: resourceDefinitions['resource-06'].capabilities.read,
345
+ resourceCode: 'resource-06',
346
+ },
347
+ {
348
+ code: 'resource:resource-07:list',
349
+ kind: 'resource-list',
350
+ path: '/admin/resources/resource-07',
351
+ label: '场地预约',
352
+ navigationEligible: true,
353
+ capability: resourceDefinitions['resource-07'].capabilities.read,
354
+ resourceCode: 'resource-07',
355
+ },
356
+ {
357
+ code: 'resource:resource-08:list',
358
+ kind: 'resource-list',
359
+ path: '/admin/resources/resource-08',
360
+ label: '场地不可用时段',
361
+ navigationEligible: true,
362
+ capability: resourceDefinitions['resource-08'].capabilities.read,
363
+ resourceCode: 'resource-08',
364
+ },
365
+ {
366
+ code: 'resource:resource-09:list',
367
+ kind: 'resource-list',
368
+ path: '/admin/resources/resource-09',
369
+ label: '场地档案',
370
+ navigationEligible: true,
371
+ capability: resourceDefinitions['resource-09'].capabilities.read,
372
+ resourceCode: 'resource-09',
373
+ },
374
+ {
375
+ code: 'resource:resource-10:list',
376
+ kind: 'resource-list',
377
+ path: '/admin/resources/resource-10',
378
+ label: '通知公告',
379
+ navigationEligible: true,
380
+ capability: resourceDefinitions['resource-10'].capabilities.read,
381
+ resourceCode: 'resource-10',
382
+ },
383
+ {
384
+ code: 'resource:resource-11:list',
385
+ kind: 'resource-list',
386
+ path: '/admin/resources/resource-11',
387
+ label: '活动报名',
388
+ navigationEligible: true,
389
+ capability: resourceDefinitions['resource-11'].capabilities.read,
390
+ resourceCode: 'resource-11',
391
+ },
392
+ {
393
+ code: 'resource:resource-12:list',
394
+ kind: 'resource-list',
395
+ path: '/admin/resources/resource-12',
396
+ label: '资料下载',
397
+ navigationEligible: true,
398
+ capability: resourceDefinitions['resource-12'].capabilities.read,
399
+ resourceCode: 'resource-12',
400
+ },
401
+ {
402
+ code: 'operation:content-operations',
403
+ kind: 'operation',
404
+ path: '/admin/operations/content',
405
+ label: '内容业务操作',
406
+ navigationEligible: true,
407
+ capability: 'app:openxiangda-application:operations:read',
408
+ routeCode: 'content-operations',
409
+ },
410
+ ]}
411
+ contributions={applicationContributions}
412
+ resourceDefinitions={resourceDefinitions}
413
+ />
414
+ </React.StrictMode>
415
+ );