openxiangda 1.0.264 → 2.0.0-alpha.2

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 (537) hide show
  1. package/README.md +11 -666
  2. package/bin/run.js +11 -0
  3. package/dist/browser/AuthoritativeSelector.d.ts +37 -0
  4. package/dist/browser/AuthoritativeSelector.d.ts.map +1 -0
  5. package/dist/browser/AuthoritativeSelector.js +357 -0
  6. package/dist/browser/AuthoritativeSelector.js.map +1 -0
  7. package/dist/browser/FilePreviewPage.d.ts +2 -0
  8. package/dist/browser/FilePreviewPage.d.ts.map +1 -0
  9. package/dist/browser/FilePreviewPage.js +191 -0
  10. package/dist/browser/FilePreviewPage.js.map +1 -0
  11. package/dist/browser/Shell.d.ts +6 -0
  12. package/dist/browser/Shell.d.ts.map +1 -0
  13. package/dist/browser/Shell.js +198 -0
  14. package/dist/browser/Shell.js.map +1 -0
  15. package/dist/browser/appearance.d.ts +12 -0
  16. package/dist/browser/appearance.d.ts.map +1 -0
  17. package/dist/browser/appearance.js +100 -0
  18. package/dist/browser/appearance.js.map +1 -0
  19. package/dist/browser/application.d.ts +8 -0
  20. package/dist/browser/application.d.ts.map +1 -0
  21. package/dist/browser/application.js +42 -0
  22. package/dist/browser/application.js.map +1 -0
  23. package/dist/browser/components/platform-fields/AddressField.d.ts +12 -0
  24. package/dist/browser/components/platform-fields/AddressField.d.ts.map +1 -0
  25. package/dist/browser/components/platform-fields/AddressField.js +179 -0
  26. package/dist/browser/components/platform-fields/AddressField.js.map +1 -0
  27. package/dist/browser/components/platform-fields/AttachmentFileList.d.ts +9 -0
  28. package/dist/browser/components/platform-fields/AttachmentFileList.d.ts.map +1 -0
  29. package/dist/browser/components/platform-fields/AttachmentFileList.js +164 -0
  30. package/dist/browser/components/platform-fields/AttachmentFileList.js.map +1 -0
  31. package/dist/browser/components/platform-fields/CascadeField.d.ts +13 -0
  32. package/dist/browser/components/platform-fields/CascadeField.d.ts.map +1 -0
  33. package/dist/browser/components/platform-fields/CascadeField.js +14 -0
  34. package/dist/browser/components/platform-fields/CascadeField.js.map +1 -0
  35. package/dist/browser/components/platform-fields/DateTimeField.d.ts +16 -0
  36. package/dist/browser/components/platform-fields/DateTimeField.d.ts.map +1 -0
  37. package/dist/browser/components/platform-fields/DateTimeField.js +51 -0
  38. package/dist/browser/components/platform-fields/DateTimeField.js.map +1 -0
  39. package/dist/browser/components/platform-fields/JsonField.d.ts +11 -0
  40. package/dist/browser/components/platform-fields/JsonField.d.ts.map +1 -0
  41. package/dist/browser/components/platform-fields/JsonField.js +40 -0
  42. package/dist/browser/components/platform-fields/JsonField.js.map +1 -0
  43. package/dist/browser/components/platform-fields/LocationField.d.ts +11 -0
  44. package/dist/browser/components/platform-fields/LocationField.d.ts.map +1 -0
  45. package/dist/browser/components/platform-fields/LocationField.js +73 -0
  46. package/dist/browser/components/platform-fields/LocationField.js.map +1 -0
  47. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts +12 -0
  48. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts.map +1 -0
  49. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js +269 -0
  50. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js.map +1 -0
  51. package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts +12 -0
  52. package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts.map +1 -0
  53. package/dist/browser/components/platform-fields/ResourceReferenceField.js +22 -0
  54. package/dist/browser/components/platform-fields/ResourceReferenceField.js.map +1 -0
  55. package/dist/browser/components/platform-fields/RichTextField.d.ts +14 -0
  56. package/dist/browser/components/platform-fields/RichTextField.d.ts.map +1 -0
  57. package/dist/browser/components/platform-fields/RichTextField.js +214 -0
  58. package/dist/browser/components/platform-fields/RichTextField.js.map +1 -0
  59. package/dist/browser/components/platform-fields/SignatureField.d.ts +15 -0
  60. package/dist/browser/components/platform-fields/SignatureField.d.ts.map +1 -0
  61. package/dist/browser/components/platform-fields/SignatureField.js +179 -0
  62. package/dist/browser/components/platform-fields/SignatureField.js.map +1 -0
  63. package/dist/browser/components/platform-fields/SubtableField.d.ts +18 -0
  64. package/dist/browser/components/platform-fields/SubtableField.d.ts.map +1 -0
  65. package/dist/browser/components/platform-fields/SubtableField.js +236 -0
  66. package/dist/browser/components/platform-fields/SubtableField.js.map +1 -0
  67. package/dist/browser/components/platform-fields/address-value.d.ts +13 -0
  68. package/dist/browser/components/platform-fields/address-value.d.ts.map +1 -0
  69. package/dist/browser/components/platform-fields/address-value.js +70 -0
  70. package/dist/browser/components/platform-fields/address-value.js.map +1 -0
  71. package/dist/browser/components/platform-fields/cascade-value.d.ts +6 -0
  72. package/dist/browser/components/platform-fields/cascade-value.d.ts.map +1 -0
  73. package/dist/browser/components/platform-fields/cascade-value.js +47 -0
  74. package/dist/browser/components/platform-fields/cascade-value.js.map +1 -0
  75. package/dist/browser/components/platform-fields/directory-value.d.ts +7 -0
  76. package/dist/browser/components/platform-fields/directory-value.d.ts.map +1 -0
  77. package/dist/browser/components/platform-fields/directory-value.js +35 -0
  78. package/dist/browser/components/platform-fields/directory-value.js.map +1 -0
  79. package/dist/browser/components/platform-fields/field-form-codec.d.ts +10 -0
  80. package/dist/browser/components/platform-fields/field-form-codec.d.ts.map +1 -0
  81. package/dist/browser/components/platform-fields/field-form-codec.js +82 -0
  82. package/dist/browser/components/platform-fields/field-form-codec.js.map +1 -0
  83. package/dist/browser/components/platform-fields/location-value.d.ts +20 -0
  84. package/dist/browser/components/platform-fields/location-value.d.ts.map +1 -0
  85. package/dist/browser/components/platform-fields/location-value.js +57 -0
  86. package/dist/browser/components/platform-fields/location-value.js.map +1 -0
  87. package/dist/browser/components/platform-fields/resource-query.d.ts +14 -0
  88. package/dist/browser/components/platform-fields/resource-query.d.ts.map +1 -0
  89. package/dist/browser/components/platform-fields/resource-query.js +102 -0
  90. package/dist/browser/components/platform-fields/resource-query.js.map +1 -0
  91. package/dist/browser/components/platform-fields/rich-text-value.d.ts +12 -0
  92. package/dist/browser/components/platform-fields/rich-text-value.d.ts.map +1 -0
  93. package/dist/browser/components/platform-fields/rich-text-value.js +83 -0
  94. package/dist/browser/components/platform-fields/rich-text-value.js.map +1 -0
  95. package/dist/browser/components/platform-fields/subtable-value.d.ts +31 -0
  96. package/dist/browser/components/platform-fields/subtable-value.d.ts.map +1 -0
  97. package/dist/browser/components/platform-fields/subtable-value.js +120 -0
  98. package/dist/browser/components/platform-fields/subtable-value.js.map +1 -0
  99. package/dist/browser/components/resource/GeneratedResourceCrud.d.ts +8 -0
  100. package/dist/browser/components/resource/GeneratedResourceCrud.d.ts.map +1 -0
  101. package/dist/browser/components/resource/GeneratedResourceCrud.js +580 -0
  102. package/dist/browser/components/resource/GeneratedResourceCrud.js.map +1 -0
  103. package/dist/browser/components/resource/ResourceBatchActions.d.ts +25 -0
  104. package/dist/browser/components/resource/ResourceBatchActions.d.ts.map +1 -0
  105. package/dist/browser/components/resource/ResourceBatchActions.js +168 -0
  106. package/dist/browser/components/resource/ResourceBatchActions.js.map +1 -0
  107. package/dist/browser/components/resource/StandardResourcePages.d.ts +57 -0
  108. package/dist/browser/components/resource/StandardResourcePages.d.ts.map +1 -0
  109. package/dist/browser/components/resource/StandardResourcePages.js +89 -0
  110. package/dist/browser/components/resource/StandardResourcePages.js.map +1 -0
  111. package/dist/browser/components/resource/SurfaceFields.d.ts +88 -0
  112. package/dist/browser/components/resource/SurfaceFields.d.ts.map +1 -0
  113. package/dist/browser/components/resource/SurfaceFields.js +497 -0
  114. package/dist/browser/components/resource/SurfaceFields.js.map +1 -0
  115. package/dist/browser/components/resource/generated-resource-definition.d.ts +19 -0
  116. package/dist/browser/components/resource/generated-resource-definition.d.ts.map +1 -0
  117. package/dist/browser/components/resource/generated-resource-definition.js +2 -0
  118. package/dist/browser/components/resource/generated-resource-definition.js.map +1 -0
  119. package/dist/browser/components/resource/resource-import.d.ts +15 -0
  120. package/dist/browser/components/resource/resource-import.d.ts.map +1 -0
  121. package/dist/browser/components/resource/resource-import.js +197 -0
  122. package/dist/browser/components/resource/resource-import.js.map +1 -0
  123. package/dist/browser/data-provider.d.ts +4 -0
  124. package/dist/browser/data-provider.d.ts.map +1 -0
  125. package/dist/browser/data-provider.js +45 -0
  126. package/dist/browser/data-provider.js.map +1 -0
  127. package/dist/browser/platform-client.d.ts +81 -0
  128. package/dist/browser/platform-client.d.ts.map +1 -0
  129. package/dist/browser/platform-client.js +422 -0
  130. package/dist/browser/platform-client.js.map +1 -0
  131. package/dist/browser/resource-definitions.d.ts +8 -0
  132. package/dist/browser/resource-definitions.d.ts.map +1 -0
  133. package/dist/browser/resource-definitions.js +14 -0
  134. package/dist/browser/resource-definitions.js.map +1 -0
  135. package/dist/browser/runtime-meta.d.ts +22 -0
  136. package/dist/browser/runtime-meta.d.ts.map +1 -0
  137. package/dist/browser/runtime-meta.js +79 -0
  138. package/dist/browser/runtime-meta.js.map +1 -0
  139. package/dist/browser/runtime.d.ts +13 -0
  140. package/dist/browser/runtime.d.ts.map +1 -0
  141. package/dist/browser/runtime.js +47 -0
  142. package/dist/browser/runtime.js.map +1 -0
  143. package/dist/browser/styles.css +1941 -0
  144. package/dist/config.d.ts +2 -0
  145. package/dist/config.d.ts.map +1 -0
  146. package/dist/config.js +2 -0
  147. package/dist/config.js.map +1 -0
  148. package/dist/core.d.ts +6 -0
  149. package/dist/core.d.ts.map +1 -0
  150. package/dist/core.js +4 -0
  151. package/dist/core.js.map +1 -0
  152. package/dist/field-kit.d.ts +22 -0
  153. package/dist/field-kit.d.ts.map +1 -0
  154. package/dist/field-kit.js +22 -0
  155. package/dist/field-kit.js.map +1 -0
  156. package/dist/index.d.ts +2 -0
  157. package/dist/index.d.ts.map +1 -0
  158. package/dist/index.js +2 -0
  159. package/dist/index.js.map +1 -0
  160. package/dist/nest.d.ts +10 -0
  161. package/dist/nest.d.ts.map +1 -0
  162. package/dist/nest.js +9 -0
  163. package/dist/nest.js.map +1 -0
  164. package/dist/react.d.ts +12 -0
  165. package/dist/react.d.ts.map +1 -0
  166. package/dist/react.js +11 -0
  167. package/dist/react.js.map +1 -0
  168. package/dist/testing.d.ts +4 -0
  169. package/dist/testing.d.ts.map +1 -0
  170. package/dist/testing.js +4 -0
  171. package/dist/testing.js.map +1 -0
  172. package/package.json +95 -200
  173. package/skills/manifest.json +10 -0
  174. package/skills/openxiangda-v2/SKILL.md +55 -0
  175. package/skills/openxiangda-v2/references/architecture.md +7 -0
  176. package/skills/openxiangda-v2/references/backend.md +116 -0
  177. package/skills/openxiangda-v2/references/data-authz.md +93 -0
  178. package/skills/openxiangda-v2/references/delivery.md +11 -0
  179. package/skills/openxiangda-v2/references/discovery.md +15 -0
  180. package/skills/openxiangda-v2/references/frontend.md +10 -0
  181. package/skills/openxiangda-v2/references/testing.md +16 -0
  182. package/skills/openxiangda-v2/references/workflow-notification.md +69 -0
  183. package/skills/openxiangda-v2/references/workspace.md +21 -0
  184. package/bin/openxiangda.js +0 -26
  185. package/lib/app-function-invoke.js +0 -28
  186. package/lib/application-environments.js +0 -1134
  187. package/lib/change-baseline.js +0 -1359
  188. package/lib/cli.js +0 -31084
  189. package/lib/config.js +0 -450
  190. package/lib/content-cache.js +0 -97
  191. package/lib/delivery-v2-cli.js +0 -329
  192. package/lib/delivery-v2-executor.js +0 -1703
  193. package/lib/delivery-v2-package.js +0 -1176
  194. package/lib/dependency-capsule.js +0 -246
  195. package/lib/design-gates.js +0 -668
  196. package/lib/design-review.js +0 -220
  197. package/lib/developer-center.js +0 -160
  198. package/lib/form-field-contract.js +0 -79
  199. package/lib/form-schema-loader.js +0 -181
  200. package/lib/git-remote-identity.js +0 -89
  201. package/lib/http.js +0 -196
  202. package/lib/integration-bundle.js +0 -225
  203. package/lib/js-code-build.js +0 -175
  204. package/lib/open-api.js +0 -256
  205. package/lib/policy.js +0 -137
  206. package/lib/publish-context.js +0 -98
  207. package/lib/publish-lease-heartbeat.js +0 -182
  208. package/lib/publish-lease.js +0 -221
  209. package/lib/release-error-classification.js +0 -41
  210. package/lib/release-explain.js +0 -75
  211. package/lib/release-mainline.js +0 -654
  212. package/lib/release-plan.js +0 -550
  213. package/lib/release-telemetry.js +0 -182
  214. package/lib/resource-binding-contract.js +0 -210
  215. package/lib/role-resolution.js +0 -57
  216. package/lib/runtime-lineage.js +0 -326
  217. package/lib/sdd.js +0 -3306
  218. package/lib/skills.js +0 -453
  219. package/lib/source-dependencies.js +0 -921
  220. package/lib/task-status.js +0 -330
  221. package/lib/utils.js +0 -178
  222. package/lib/workspace-bootstrap.js +0 -268
  223. package/lib/workspace-init.js +0 -202
  224. package/lib/worktree-cleanup.js +0 -631
  225. package/lib/worktree-owner.js +0 -354
  226. package/openxiangda-skills/SKILL.md +0 -226
  227. package/openxiangda-skills/references/architecture-design.md +0 -409
  228. package/openxiangda-skills/references/architecture-patterns.md +0 -264
  229. package/openxiangda-skills/references/automation-v3.md +0 -349
  230. package/openxiangda-skills/references/best-practices.md +0 -272
  231. package/openxiangda-skills/references/component-guide.md +0 -287
  232. package/openxiangda-skills/references/connector-resources.md +0 -80
  233. package/openxiangda-skills/references/data-views.md +0 -360
  234. package/openxiangda-skills/references/forms/component-registry.md +0 -90
  235. package/openxiangda-skills/references/forms/form-schema.md +0 -146
  236. package/openxiangda-skills/references/forms/layout-and-rules.md +0 -24
  237. package/openxiangda-skills/references/notifications.md +0 -227
  238. package/openxiangda-skills/references/openxiangda-api.md +0 -971
  239. package/openxiangda-skills/references/pages/app-shell.md +0 -66
  240. package/openxiangda-skills/references/pages/page-sdk.md +0 -401
  241. package/openxiangda-skills/references/pages/publish-flow.md +0 -84
  242. package/openxiangda-skills/references/pages/workspace-structure.md +0 -41
  243. package/openxiangda-skills/references/permission-design-patterns.md +0 -313
  244. package/openxiangda-skills/references/permissions-settings.md +0 -468
  245. package/openxiangda-skills/references/platform-data-model.md +0 -340
  246. package/openxiangda-skills/references/resource-manifest-cheatsheet.md +0 -936
  247. package/openxiangda-skills/references/school-contact-relations.md +0 -224
  248. package/openxiangda-skills/references/style-system.md +0 -218
  249. package/openxiangda-skills/references/troubleshooting.md +0 -271
  250. package/openxiangda-skills/references/workflow-v3.md +0 -441
  251. package/openxiangda-skills/references/workspace-state.md +0 -115
  252. package/openxiangda-skills/skills/openxiangda-app/SKILL.md +0 -118
  253. package/openxiangda-skills/skills/openxiangda-architecture-design/SKILL.md +0 -137
  254. package/openxiangda-skills/skills/openxiangda-core/SKILL.md +0 -222
  255. package/openxiangda-skills/skills/openxiangda-form/SKILL.md +0 -184
  256. package/openxiangda-skills/skills/openxiangda-inspect/SKILL.md +0 -63
  257. package/openxiangda-skills/skills/openxiangda-open-api/SKILL.md +0 -57
  258. package/openxiangda-skills/skills/openxiangda-open-api/agents/openai.yaml +0 -4
  259. package/openxiangda-skills/skills/openxiangda-open-api/references/backend-authentication.md +0 -63
  260. package/openxiangda-skills/skills/openxiangda-open-api/references/dingtalk-api.openapi.json +0 -15653
  261. package/openxiangda-skills/skills/openxiangda-page/SKILL.md +0 -154
  262. package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +0 -209
  263. package/openxiangda-skills/skills/openxiangda-workflow-automation/SKILL.md +0 -201
  264. package/packages/sdk/bin/lowcode-workspace.mjs +0 -4
  265. package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.mts +0 -1292
  266. package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.ts +0 -1292
  267. package/packages/sdk/dist/build/index.cjs +0 -1
  268. package/packages/sdk/dist/build/index.d.mts +0 -60
  269. package/packages/sdk/dist/build/index.d.ts +0 -60
  270. package/packages/sdk/dist/build/index.mjs +0 -1
  271. package/packages/sdk/dist/components/index.cjs +0 -148
  272. package/packages/sdk/dist/components/index.d.mts +0 -970
  273. package/packages/sdk/dist/components/index.d.ts +0 -970
  274. package/packages/sdk/dist/components/index.mjs +0 -148
  275. package/packages/sdk/dist/dataManagementApi-Ro9itwm8.d.ts +0 -142
  276. package/packages/sdk/dist/dataManagementApi-p_HOhQnA.d.mts +0 -142
  277. package/packages/sdk/dist/runtime/index.cjs +0 -148
  278. package/packages/sdk/dist/runtime/index.d.mts +0 -171
  279. package/packages/sdk/dist/runtime/index.d.ts +0 -171
  280. package/packages/sdk/dist/runtime/index.mjs +0 -148
  281. package/packages/sdk/dist/runtime/react.cjs +0 -148
  282. package/packages/sdk/dist/runtime/react.d.mts +0 -3202
  283. package/packages/sdk/dist/runtime/react.d.ts +0 -3202
  284. package/packages/sdk/dist/runtime/react.mjs +0 -148
  285. package/packages/sdk/dist/styles/antd-theme.cjs +0 -1
  286. package/packages/sdk/dist/styles/antd-theme.d.mts +0 -6
  287. package/packages/sdk/dist/styles/antd-theme.d.ts +0 -6
  288. package/packages/sdk/dist/styles/antd-theme.mjs +0 -1
  289. package/packages/sdk/dist/styles/tailwind-preset.cjs +0 -1
  290. package/packages/sdk/dist/styles/tailwind-preset.d.mts +0 -74
  291. package/packages/sdk/dist/styles/tailwind-preset.d.ts +0 -74
  292. package/packages/sdk/dist/styles/tailwind-preset.mjs +0 -1
  293. package/packages/sdk/dist/styles/tokens.css +0 -74
  294. package/packages/sdk/dist/workflow/index.cjs +0 -3
  295. package/packages/sdk/dist/workflow/index.d.mts +0 -291
  296. package/packages/sdk/dist/workflow/index.d.ts +0 -291
  297. package/packages/sdk/dist/workflow/index.mjs +0 -3
  298. package/packages/sdk/source/admin-list/AdminList.tsx +0 -1734
  299. package/packages/sdk/source/admin-list/README.md +0 -12
  300. package/packages/sdk/source/admin-list/dataSources.ts +0 -345
  301. package/packages/sdk/source/admin-list/index.ts +0 -42
  302. package/packages/sdk/source/admin-list/preferences.ts +0 -174
  303. package/packages/sdk/source/admin-list/types.ts +0 -273
  304. package/packages/sdk/src/build-source/README.md +0 -9
  305. package/packages/sdk/src/build-source/bin/lowcode-workspace.mjs +0 -7
  306. package/packages/sdk/src/build-source/package.json +0 -34
  307. package/packages/sdk/src/build-source/scripts/build-forms.mjs +0 -1129
  308. package/packages/sdk/src/build-source/scripts/build-pages.mjs +0 -897
  309. package/packages/sdk/src/build-source/scripts/build-workspace.mjs +0 -89
  310. package/packages/sdk/src/build-source/scripts/publish-all.mjs +0 -190
  311. package/packages/sdk/src/build-source/scripts/publish-oss.mjs +0 -144
  312. package/packages/sdk/src/build-source/scripts/register-bundle.mjs +0 -1
  313. package/packages/sdk/src/build-source/scripts/register.mjs +0 -362
  314. package/packages/sdk/src/build-source/scripts/sync-schema.mjs +0 -381
  315. package/packages/sdk/src/build-source/scripts/utils/form-api.mjs +0 -1058
  316. package/packages/sdk/src/build-source/scripts/utils/form-runtime-assets.mjs +0 -57
  317. package/packages/sdk/src/build-source/scripts/utils/incremental.mjs +0 -348
  318. package/packages/sdk/src/build-source/scripts/utils/load-config.mjs +0 -331
  319. package/packages/sdk/src/build-source/scripts/utils/mime-types.mjs +0 -70
  320. package/packages/sdk/src/build-source/scripts/utils/namespace-css.mjs +0 -77
  321. package/packages/sdk/src/build-source/scripts/utils/oss-client.mjs +0 -128
  322. package/packages/sdk/src/build-source/scripts/utils/pages.mjs +0 -150
  323. package/packages/sdk/src/build-source/scripts/utils/progress.mjs +0 -57
  324. package/packages/sdk/src/build-source/scripts/utils/publish-oss-patterns.mjs +0 -20
  325. package/packages/sdk/src/build-source/scripts/utils/register-payload.mjs +0 -90
  326. package/packages/sdk/src/build-source/scripts/utils/runtime-css-check.mjs +0 -44
  327. package/packages/sdk/src/build-source/scripts/utils/schema-transform.mjs +0 -142
  328. package/packages/sdk/src/build-source/scripts/utils/static-assets.mjs +0 -165
  329. package/packages/sdk/src/build-source/scripts/utils/tailwind-config.mjs +0 -283
  330. package/packages/sdk/src/build-source/scripts/utils/tailwind-token-warnings.mjs +0 -146
  331. package/packages/sdk/src/build-source/scripts/utils/workspace-style-entry.mjs +0 -29
  332. package/packages/sdk/src/build-source/src/cli.mjs +0 -735
  333. package/policy/openxiangda-policy.json +0 -72
  334. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-form.mdc +0 -24
  335. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-page.mdc +0 -25
  336. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-resources.mdc +0 -32
  337. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-workflow-automation.mdc +0 -26
  338. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +0 -68
  339. package/templates/openxiangda-react-spa/.env.example +0 -4
  340. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-form.md +0 -37
  341. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-page.md +0 -29
  342. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-resources.md +0 -32
  343. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-workflow-automation.md +0 -34
  344. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +0 -66
  345. package/templates/openxiangda-react-spa/AGENTS.md +0 -192
  346. package/templates/openxiangda-react-spa/DELIVERY.md +0 -43
  347. package/templates/openxiangda-react-spa/app-workspace.config.ts +0 -50
  348. package/templates/openxiangda-react-spa/index.html +0 -12
  349. package/templates/openxiangda-react-spa/package.json +0 -53
  350. package/templates/openxiangda-react-spa/postcss.config.cjs +0 -6
  351. package/templates/openxiangda-react-spa/scripts/build-js-code.mjs +0 -600
  352. package/templates/openxiangda-react-spa/scripts/deploy.mjs +0 -18
  353. package/templates/openxiangda-react-spa/scripts/guard-publish.mjs +0 -21
  354. package/templates/openxiangda-react-spa/src/app/navigation.ts +0 -73
  355. package/templates/openxiangda-react-spa/src/app/router.tsx +0 -146
  356. package/templates/openxiangda-react-spa/src/app/starter-content.ts +0 -144
  357. package/templates/openxiangda-react-spa/src/forms/.gitkeep +0 -1
  358. package/templates/openxiangda-react-spa/src/layouts/AdminShell.tsx +0 -570
  359. package/templates/openxiangda-react-spa/src/main.tsx +0 -21
  360. package/templates/openxiangda-react-spa/src/pages/admin/AdminDashboardPage.tsx +0 -170
  361. package/templates/openxiangda-react-spa/src/pages/admin/LoginLogPage.tsx +0 -425
  362. package/templates/openxiangda-react-spa/src/pages/defaults/DataRoutePage.tsx +0 -36
  363. package/templates/openxiangda-react-spa/src/pages/defaults/FilePreviewRoutePage.tsx +0 -65
  364. package/templates/openxiangda-react-spa/src/pages/defaults/FormRoutePage.tsx +0 -235
  365. package/templates/openxiangda-react-spa/src/pages/public/PublicRegisterPage.tsx +0 -15
  366. package/templates/openxiangda-react-spa/src/pages/states/NotFoundPage.tsx +0 -31
  367. package/templates/openxiangda-react-spa/src/resources/menus/menus.json +0 -22
  368. package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/app-admin.json +0 -8
  369. package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/public-visitor.json +0 -8
  370. package/templates/openxiangda-react-spa/src/resources/public-access/public-register.json +0 -14
  371. package/templates/openxiangda-react-spa/src/resources/roles/roles.json +0 -15
  372. package/templates/openxiangda-react-spa/src/resources/routes/public-register.json +0 -8
  373. package/templates/openxiangda-react-spa/src/runtime/default-page-overrides.tsx +0 -35
  374. package/templates/openxiangda-react-spa/src/runtime/default-routes.ts +0 -16
  375. package/templates/openxiangda-react-spa/src/shared/form-schema.ts +0 -135
  376. package/templates/openxiangda-react-spa/src/shared/mac-admin.tsx +0 -651
  377. package/templates/openxiangda-react-spa/src/shared/ui.tsx +0 -22
  378. package/templates/openxiangda-react-spa/src/styles/index.css +0 -105
  379. package/templates/openxiangda-react-spa/tailwind.config.cjs +0 -37
  380. package/templates/openxiangda-react-spa/tsconfig.app.json +0 -36
  381. package/templates/openxiangda-react-spa/tsconfig.js-code-nodes.json +0 -19
  382. package/templates/openxiangda-react-spa/tsconfig.json +0 -7
  383. package/templates/openxiangda-react-spa/tsconfig.node.json +0 -10
  384. package/templates/openxiangda-react-spa/vite.config.ts +0 -209
  385. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-form.mdc +0 -24
  386. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-page.mdc +0 -21
  387. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-resources.mdc +0 -40
  388. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-workflow-automation.mdc +0 -21
  389. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +0 -81
  390. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-form.md +0 -38
  391. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-page.md +0 -39
  392. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-resources.md +0 -59
  393. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-workflow-automation.md +0 -46
  394. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +0 -82
  395. package/templates/sy-lowcode-app-workspace/AGENTS.md +0 -158
  396. package/templates/sy-lowcode-app-workspace/DELIVERY.md +0 -43
  397. package/templates/sy-lowcode-app-workspace/app-workspace.config.ts +0 -51
  398. package/templates/sy-lowcode-app-workspace/examples/best-practices/README.md +0 -43
  399. package/templates/sy-lowcode-app-workspace/examples/best-practices/access-governance.md +0 -239
  400. package/templates/sy-lowcode-app-workspace/examples/best-practices/catalog.json +0 -99
  401. package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +0 -94
  402. package/templates/sy-lowcode-app-workspace/examples/best-practices/design-style.md +0 -91
  403. package/templates/sy-lowcode-app-workspace/examples/best-practices/module-structure.md +0 -48
  404. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/index.ts +0 -2
  405. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.test.ts +0 -52
  406. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.ts +0 -37
  407. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/types.ts +0 -19
  408. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/index.ts +0 -4
  409. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.test.ts +0 -42
  410. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.ts +0 -25
  411. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.test.ts +0 -63
  412. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.ts +0 -73
  413. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.test.ts +0 -34
  414. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.ts +0 -73
  415. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/types.ts +0 -66
  416. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/page.tsx +0 -1
  417. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/schema.ts +0 -109
  418. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/page.tsx +0 -1
  419. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/schema.ts +0 -92
  420. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/page.tsx +0 -1
  421. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/schema.ts +0 -153
  422. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/page.tsx +0 -1
  423. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/schema.ts +0 -65
  424. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/daily_ticket_digest/index.ts +0 -44
  425. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/sync_roles_to_platform/index.ts +0 -33
  426. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/App.tsx +0 -8
  427. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/GlassHomeDashboard.tsx +0 -232
  428. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/index.tsx +0 -10
  429. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/page.config.ts +0 -14
  430. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/styles.css +0 -196
  431. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/App.tsx +0 -7
  432. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/WorkbenchPage.tsx +0 -36
  433. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/ConfigPanel.tsx +0 -34
  434. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/PreviewPanel.tsx +0 -17
  435. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/index.tsx +0 -10
  436. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/page.config.ts +0 -9
  437. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/reducer.ts +0 -29
  438. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/styles.css +0 -24
  439. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/App.tsx +0 -8
  440. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/MintAnalyticsDashboard.tsx +0 -279
  441. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/index.tsx +0 -10
  442. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/page.config.ts +0 -14
  443. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/styles.css +0 -163
  444. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/App.tsx +0 -7
  445. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/MobilePortalShell.tsx +0 -31
  446. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/index.tsx +0 -10
  447. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/modules/MobileHome.tsx +0 -13
  448. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/page.config.ts +0 -14
  449. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/routes.ts +0 -13
  450. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/styles.css +0 -11
  451. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/App.tsx +0 -8
  452. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/OpsMonitorDashboard.tsx +0 -306
  453. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/index.tsx +0 -10
  454. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/page.config.ts +0 -14
  455. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/styles.css +0 -248
  456. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/App.tsx +0 -7
  457. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/PcPortalShell.tsx +0 -35
  458. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/components/PortalMetric.tsx +0 -11
  459. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/index.tsx +0 -10
  460. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/HomeModule.tsx +0 -25
  461. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/TicketsModule.tsx +0 -14
  462. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/page.config.ts +0 -14
  463. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/routes.ts +0 -19
  464. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/styles.css +0 -35
  465. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/App.tsx +0 -7
  466. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/TicketOpsPage.tsx +0 -105
  467. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketActionTimeline.tsx +0 -22
  468. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketDetailDrawer.tsx +0 -44
  469. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketTableActions.tsx +0 -57
  470. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/index.tsx +0 -10
  471. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/page.config.ts +0 -9
  472. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/styles.css +0 -35
  473. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/App.tsx +0 -8
  474. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/WorkOrderListDrawerPage.tsx +0 -371
  475. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/index.tsx +0 -10
  476. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/page.config.ts +0 -14
  477. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/styles.css +0 -182
  478. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/automation.json +0 -25
  479. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/trigger.json +0 -9
  480. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/notifications/daily-ticket-digest.json +0 -24
  481. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/form-groups/service-ticket-college.json +0 -21
  482. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/roles.json +0 -17
  483. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/workflows/expense-approval-workflow.json +0 -48
  484. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/ConfirmAction.tsx +0 -22
  485. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/QueryState.tsx +0 -37
  486. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/StatusTag.tsx +0 -20
  487. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/DashboardPrimitives.tsx +0 -832
  488. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/chartOptions.ts +0 -140
  489. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/sampleData.ts +0 -466
  490. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/styles.css +0 -874
  491. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/types.ts +0 -150
  492. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/hooks/useTicketOps.ts +0 -96
  493. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/role-governance.ts +0 -48
  494. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/service-ticket.ts +0 -113
  495. package/templates/sy-lowcode-app-workspace/examples/forms/customer/page.tsx +0 -1
  496. package/templates/sy-lowcode-app-workspace/examples/forms/customer/schema.ts +0 -36
  497. package/templates/sy-lowcode-app-workspace/index.html +0 -12
  498. package/templates/sy-lowcode-app-workspace/package.json +0 -58
  499. package/templates/sy-lowcode-app-workspace/postcss.config.cjs +0 -9
  500. package/templates/sy-lowcode-app-workspace/scripts/build-js-code.mjs +0 -600
  501. package/templates/sy-lowcode-app-workspace/scripts/guard-publish.mjs +0 -29
  502. package/templates/sy-lowcode-app-workspace/src/dev/App.tsx +0 -820
  503. package/templates/sy-lowcode-app-workspace/src/forms/.gitkeep +0 -1
  504. package/templates/sy-lowcode-app-workspace/src/forms/README.md +0 -52
  505. package/templates/sy-lowcode-app-workspace/src/index.css +0 -26
  506. package/templates/sy-lowcode-app-workspace/src/js-code-nodes/.gitkeep +0 -1
  507. package/templates/sy-lowcode-app-workspace/src/js-code-nodes/types.d.ts +0 -3
  508. package/templates/sy-lowcode-app-workspace/src/main.tsx +0 -29
  509. package/templates/sy-lowcode-app-workspace/src/pages/.gitkeep +0 -1
  510. package/templates/sy-lowcode-app-workspace/src/runtime/builtin-overrides.tsx +0 -8
  511. package/templates/sy-lowcode-app-workspace/src/shared/form-schema.ts +0 -135
  512. package/templates/sy-lowcode-app-workspace/src/types/app-workspace.types.ts +0 -88
  513. package/templates/sy-lowcode-app-workspace/tailwind.config.cjs +0 -31
  514. package/templates/sy-lowcode-app-workspace/tsconfig.app.json +0 -40
  515. package/templates/sy-lowcode-app-workspace/tsconfig.examples.json +0 -24
  516. package/templates/sy-lowcode-app-workspace/tsconfig.js-code-nodes.json +0 -19
  517. package/templates/sy-lowcode-app-workspace/tsconfig.json +0 -7
  518. package/templates/sy-lowcode-app-workspace/tsconfig.node.json +0 -10
  519. package/templates/sy-lowcode-app-workspace/vite.config.ts +0 -85
  520. package/v2/README.md +0 -35
  521. package/v2/skills/manifest.json +0 -45
  522. package/v2/skills/openxiangda-v1-maintenance/SKILL.md +0 -21
  523. package/v2/skills/openxiangda-v1-maintenance/agents/openai.yaml +0 -4
  524. package/v2/skills/openxiangda-v2/SKILL.md +0 -38
  525. package/v2/skills/openxiangda-v2-architecture/SKILL.md +0 -29
  526. package/v2/skills/openxiangda-v2-architecture/agents/openai.yaml +0 -4
  527. package/v2/skills/openxiangda-v2-backend/SKILL.md +0 -28
  528. package/v2/skills/openxiangda-v2-backend/agents/openai.yaml +0 -4
  529. package/v2/skills/openxiangda-v2-data-authz/SKILL.md +0 -28
  530. package/v2/skills/openxiangda-v2-data-authz/agents/openai.yaml +0 -4
  531. package/v2/skills/openxiangda-v2-delivery/SKILL.md +0 -30
  532. package/v2/skills/openxiangda-v2-delivery/agents/openai.yaml +0 -4
  533. package/v2/skills/openxiangda-v2-frontend/SKILL.md +0 -21
  534. package/v2/skills/openxiangda-v2-frontend/agents/openai.yaml +0 -4
  535. package/v2/skills/openxiangda-v2-workflow-events/SKILL.md +0 -28
  536. package/v2/skills/openxiangda-v2-workflow-events/agents/openai.yaml +0 -4
  537. /package/{v2/skills → skills}/openxiangda-v2/agents/openai.yaml +0 -0
@@ -1,409 +0,0 @@
1
- # OpenXiangda Architecture Design Reference
2
-
3
- Use this reference to turn product material into an OpenXiangda-specific architecture document and task plan.
4
-
5
- ## Table Of Contents
6
-
7
- - [Purpose](#purpose)
8
- - [Critical Review Stance](#critical-review-stance)
9
- - [Architecture Gate Workflow](#architecture-gate-workflow)
10
- - [Anti-Patterns To Reject](#anti-patterns-to-reject)
11
- - [Question Gates](#question-gates)
12
- - [Resource Design Checklist](#resource-design-checklist)
13
- - [Final Document Template](#final-document-template)
14
- - [Black-Box Demo Scenario](#black-box-demo-scenario)
15
-
16
- ## Purpose
17
-
18
- This design flow is for applications built on OpenXiangda. The output is not a generic PRD. It must tell the implementer exactly which platform resources to create and why:
19
-
20
- - forms and fields
21
- - custom pages and menus
22
- - data views
23
- - roles, page permission groups, form permission groups, data scopes, and field access
24
- - status machines or workflows
25
- - automations, JS_CODE V2 nodes, and App Functions
26
- - notifications and connectors
27
- - application login/auth methods, registration policy, identity matching, and provider boundaries
28
- - public access routes, external roles, ticket strategy, and explicit grants
29
- - publish and acceptance steps
30
-
31
- The design is complete only when another agent can implement it without deciding major architecture tradeoffs.
32
-
33
- ## Critical Review Stance
34
-
35
- Act as the technical architect. Product requirements are inputs, not orders.
36
-
37
- Be direct when a requirement is technically wrong:
38
-
39
- - "这个设计不能按你说的实现。把 1000 条数据拉到前端再筛选,会在真实数据量下变慢,也会绕开后端权限边界。这里必须做分页查询和服务端过滤。"
40
- - "这不是审批流,是业务状态流转。硬做成流程表单会让页面、权限、数据修复和后续扩展都变复杂。应该用普通表单 + 状态机。"
41
- - "前端隐藏按钮不是权限控制。敏感数据必须落到表单权限组、数据范围和字段权限。"
42
-
43
- Do not insult the person. Criticize the proposal and explain the technical consequence.
44
-
45
- ## Architecture Gate Workflow
46
-
47
- Before any implementation for architecture-class work, run the CLI gate when available:
48
-
49
- ```bash
50
- openxiangda doctor --profile <name> --json
51
- openxiangda design gates --topic public-access --json
52
- openxiangda design template --topic auth,public-access
53
- ```
54
-
55
- Until the user confirms the design, only read, inspect, snapshot, dry-run, ask questions, and write/output the architecture document. Do not edit app source, mutate platform resources, publish, deploy, send notifications, or invoke live write/delete endpoints.
56
-
57
- 1. **Read the input**: user prompt, uploaded requirements, current workspace files, app snapshots, and existing resources.
58
- 2. **Classify the app**: admin CRUD, portal, workbench, dashboard, workflow approval, status lifecycle, automation-heavy app, integration-heavy app, or mixed.
59
- 3. **Draft the resource map**:
60
- - forms as data tables
61
- - pages/routes/menus
62
- - permissions
63
- - data views
64
- - workflow/status/automation/function boundaries
65
- - notifications/connectors
66
- 4. **Ask missing high-impact questions**. Ask in small rounds; do not dump every possible question at once.
67
- 5. **Reject bad assumptions** and replace them with OpenXiangda-native patterns.
68
- 6. **Confirm UI design needs**. For portals, dashboards, mobile pages, and workbenches, ask whether to run Product Design / visual ideation before implementation.
69
- 7. **Write the design artifact**. Default path when a workspace exists:
70
- `docs/architecture/<app-slug>-openxiangda-design.md`.
71
- 8. **Create a development task table** that can be executed by OpenXiangda subskills.
72
-
73
- ## Design Gate Matrix
74
-
75
- Use this matrix to decide what to ask. Ask in small rounds, and recommend the default option when the user is unsure.
76
-
77
- | Topic | Trigger examples | Must confirm | Recommended default | Resources to design | Acceptance |
78
- |---|---|---|---|---|---|
79
- | 新应用 / 大版本 | 新应用、从零搭建、门户、管理系统 | actors, core objects, internal/external access, first screen, integrations | React SPA + `src/resources/**` + design doc first | forms, routes, menus, roles, dataViews, auth/public policies | user confirms resource map and permission matrix |
80
- | 复杂页面 / 工作台 | 看板、工作台、详情页、移动端、大屏 | page task, data source, edits/batch actions, role visibility, empty/error states | dataView for repeated reads, App Function for backend orchestration | route/menu, page component, dataView/function, permissions | role-specific UI works; no PageProvider errors |
81
- | 登录 / 注册 | 登录、注册、手机号验证码、SSO、账号绑定 | methods, registration policy, identity match keys, provider function, default roles, rate limits | `registration.mode=reject`; provider returns identity assertion only | `src/resources/auth`, login route/page, App Function provider | methods match SDK DTO; internal route requires auth |
82
- | 公开访问 | 无需登录、外部人员、公开报名、分享链接 | public routes, external roles, guest vs ticket, grants, rate limit, audit/expiry | `/view/:appType/public/*` + route + public-access policy; sensitive lookup uses ticket | `src/resources/routes`, `src/resources/public-access`, external role permission groups, `PublicAccessGate` | no-login public route works; ungranted resources deny |
83
- | 权限 / 数据范围 | 角色、只看自己、部门数据、字段权限 | roles, page/menu groups, form operations, data scope, field access, rejection tests | backend permission groups, not frontend-only filtering | roles, page-groups, form-groups, field access policy | `permission audit` clean; allowed/denied paths verified |
84
- | 流程 / 自动化 / Function | 审批、状态流转、定时、JS_CODE、App Function | trigger, node IO, idempotency, resources, approval vs status machine, logs | normal status machine unless real approval; reusable logic as App Function | workflows, automations, functions, JS_CODE source | invoke/executions/logs verified; duplicate trigger safe |
85
- | 连接器 / 通知 | 第三方接口、Webhook、短信、钉钉、消息 | auth, timeout/retry, secret owner, notification type/template, recipients, failure policy | connector for external HTTP; notification resources before sending | connectors, notifications, App Function wrapper if needed | `connector invoke` and notification preview/send DTOs pass |
86
- | 资源维护 | 补路由、修权限、删除配置、同步 manifest | live mutation or repo source of truth, profile/appType, force/delete/send risk | `resource plan/publish` for formal changes; direct CLI with `--write-manifest` for small fixes | affected manifest and state mapping | dry-run path/body reviewed; no repo/platform drift |
87
-
88
- ## Anti-Patterns To Reject
89
-
90
- | Anti-pattern | Why it is wrong | Required replacement |
91
- |---|---|---|
92
- | Fetch 1000 rows then filter in React state | Breaks at real data volume, wastes network, and may bypass data permission thinking | Paginated query with `currentPage`, `pageSize`, sort, and structured server filters |
93
- | Dropdown options load all records | Large forms become slow and stale | `linkedForm` `SelectField` with `remoteSearch`, explicit `searchFieldId`, and page size |
94
- | Broad `searchKeyWord` for every search | Expensive and imprecise | Explicit searchable fields and `filterGroup` OR conditions |
95
- | Workflow form for normal ticket lifecycle | Adds approval constraints and operational overhead without approval semantics | Normal form + status field + state machine + action log + automations |
96
- | Frontend-only data isolation | Hides UI but does not enforce data access | Page permission groups, form permission groups, data scopes, and field access |
97
- | One large page owns all business logic | Hard to test and change | `domain/`, `shared/services/`, hooks, reusable components |
98
- | Repeated multi-form joins in page code | Duplicated, slow, inconsistent | Data View for read-only reusable row/aggregate queries |
99
- | Materialized view for hard realtime data | Users see stale data | `storageMode: "live"` only for bounded realtime joins, or direct source queries/App Function |
100
- | Live view for unbounded heavy joins | Slow runtime queries | Materialized view with scheduled refresh and indexes |
101
- | JS_CODE for reusable business service | Logic gets duplicated in graph nodes | App Function for shared backend logic; JS_CODE only for node-local trigger logic |
102
- | Auth provider issues tokens or writes users directly | Breaks platform account, binding, permission, and audit boundaries | Provider returns identity assertion only; platform creates/binds/rejects and issues token |
103
- | Phone-code login auto-registers by default | Allows uncontrolled account creation from weak identity proof | Default registration is reject; enable auto-create/whitelist only after explicit confirmation |
104
- | Raw native form controls | Inconsistent with platform runtime and validation | OpenXiangda platform components first, Ant Design wrappers second |
105
- | Multiple form permission groups without stable local codes | CLI state and platform `resourceCode` cannot reliably distinguish groups on the same form | Give every group a unique `code`, for example `ticket_reporter_view` and `ticket_repairer_view` |
106
- | Assuming resource publish means workflow is active | Workflow resources may exist as drafts until explicitly published | Verify `workflow list` shows `isPublished: true`; run `workflow publish <workflowCode>` when needed |
107
-
108
- ## Question Gates
109
-
110
- Ask only what materially changes the design.
111
-
112
- ### Scope And Actors
113
-
114
- - Who are the user roles?
115
- - Which roles create, process, approve, view, export, or administer data?
116
- - Is this PC-only, mobile-only, or both?
117
- - Is the app greenfield or modifying an existing app?
118
-
119
- ### Forms And Data
120
-
121
- - What are the core business objects?
122
- - Which objects need independent lifecycle, permissions, or reporting?
123
- - Which fields are visible to users, hidden scope keys, computed fields, or system-derived fields?
124
- - Which fields will be searched, sorted, grouped, or used for permissions?
125
- - What data volume is expected now and after growth?
126
-
127
- ### Pagination And Search
128
-
129
- - Which list pages need filters?
130
- - Which fields support exact filtering versus fuzzy search?
131
- - Which selectors need remote search?
132
- - What default page size is acceptable?
133
- - Which sorts are business-critical?
134
-
135
- Default if the user does not know: design conservative pagination with explicit filters, do not fetch all rows.
136
-
137
- ### Permissions
138
-
139
- - Is data sensitive?
140
- - Is frontend-only filtering acceptable, or must backend data isolation be enforced?
141
- - Does each role see all records, own records, department records, assigned records, or a custom scope?
142
- - Are any fields sensitive enough for backend field access policy?
143
- - Are page permission groups enough for visibility, or do forms also need permission groups?
144
-
145
- Default: if the app contains personal data, costs, approval records, or cross-department data, backend-enforced permissions are required.
146
-
147
- ### Status Machine Or Workflow
148
-
149
- - Is there an actual approver task with agree/reject opinion and approval history?
150
- - Does each node require field permissions?
151
- - Is audit history tied to approval tasks, or is a business action log enough?
152
- - Can the process be represented as a normal status transition?
153
-
154
- Default: ordinary service, ticket, order, asset, and task lifecycles are status machines, not workflow forms.
155
-
156
- ### Data Views And Reports
157
-
158
- - Is the query single-form CRUD or repeated multi-form read-only logic?
159
- - Is the output row-level or aggregate?
160
- - Must users see source changes immediately?
161
- - What staleness is acceptable: realtime, 10-30 minutes, hourly, daily, manual?
162
- - Which fields are filters, dimensions, measures, drill-down keys, and permission scope aliases?
163
- - What rows can be excluded early by definition `where`?
164
-
165
- Default: management dashboards usually use materialized views with scheduled refresh. Operational bounded drill-downs can use live views.
166
-
167
- ### Automation, JS_CODE, App Function
168
-
169
- - What should happen after form submit/update/delete or field change?
170
- - Are there scheduled scans or deadline reminders?
171
- - Does logic need to be reused by pages and multiple backend flows?
172
- - Does it need external HTTP or platform API calls?
173
- - Which logs are needed for diagnosis?
174
-
175
- Default: reusable calculations and validations become App Functions; one-off backend trigger orchestration becomes JS_CODE V2 in automation/workflow.
176
-
177
- ### Notifications And Connectors
178
-
179
- - Which channels are required: in-app, email, DingTalk, WeChat, third-party todo?
180
- - Who receives each notification and why?
181
- - Which payload fields are needed?
182
- - Are templates reusable resources?
183
- - Are external credentials needed? If yes, use connectors/resources, never page source secrets.
184
-
185
- ### Login And Auth
186
-
187
- Ask these before generating any login/auth design:
188
-
189
- - Which methods are enabled: password, DingTalk browser OAuth/in-app free login, CAS/SSO, phone code, guest?
190
- - What is the phone registration policy: reject, auto-create, bind existing only, whitelist, or manual approval?
191
- - What are the identity match keys and priorities: `phone`, `email`, `externalId`, `unionId`, `jobNumber`, `username`?
192
- - Which App Function provider validates each external credential, and what identity assertion fields must it return?
193
- - Which default app roles/page groups/data scopes should new users receive, if registration is enabled?
194
- - What are the security parameters: code TTL, send frequency, failed attempts, IP/device limits, audit fields, and failure message disclosure?
195
- - Is CAS/DingTalk configured by the platform tenant, or delegated to an app-level provider function?
196
-
197
- Default: registration is rejected; provider functions return identity assertions only; platform auth service owns account creation, binding, permission assignment, cookies, and tokens.
198
-
199
- ### Public Access
200
-
201
- Ask these before designing any page or data that external people can access without normal login:
202
-
203
- - Which exact routes are public? Use `/view/:appType/public/*` for new React SPA apps.
204
- - What can anonymous/external users do: view a page only, submit a form, query a dataView, invoke a function, or call a connector-backed action?
205
- - Which virtual external role codes should represent these visitors, for example `external_visitor`, `external_applicant`, or `external_ticket_holder`?
206
- - Is ordinary guest mode enough, or does the link need `mode: "ticket"` with expiry/single-use behavior?
207
- - Which forms/dataViews/functions/connectors are explicitly granted? Everything not listed in `grants` is denied.
208
- - Which backend permission groups must also include the external role codes?
209
- - Is the page safe for search/share, or should the URL contain a generated ticket?
210
-
211
- Recommended default if the user is unsure:
212
-
213
- - Public marketing/info pages: `mode: "guest"`, no data grants.
214
- - Public form submission: `mode: "guest"` plus one form grant and a submit permission group for `external_visitor`.
215
- - Sensitive lookup or status query: `mode: "ticket"` plus one dataView/function grant, short TTL, and a read-only permission group.
216
- - Never use old `?publicAccess=guest` for new React SPA apps; it is legacy `sy-lowcode-view` compatibility only.
217
-
218
- ### UI Design
219
-
220
- Ask whether to use Product Design or another design skill for:
221
-
222
- - dashboard
223
- - portal
224
- - mobile entry
225
- - workbench
226
- - dense operation console
227
- - executive report page
228
- - visually important landing/first screen
229
-
230
- For simple CRUD/admin lists, design can proceed with the appropriate OpenXiangda template unless the user asks for visual exploration.
231
-
232
- ## Resource Design Checklist
233
-
234
- ### Forms
235
-
236
- - Use deterministic `formCode`.
237
- - Define visible fields, hidden scope keys, and derived values.
238
- - Use platform field components.
239
- - Use `SelectField` / `RadioField` for enums.
240
- - Use `linkedForm` select with remote search for large source forms.
241
- - Avoid extra system metadata fields unless they represent a separate business concept.
242
-
243
- ### Pages
244
-
245
- - Choose React SPA or classic workspace based on the app mode.
246
- - Use `DataManagementList` for standard management lists.
247
- - Split PC/mobile when workflows differ, but reuse `domain/` and `shared/services/`.
248
- - Keep page components thin.
249
-
250
- ### Permissions
251
-
252
- - App roles use stable local codes.
253
- - Page permission groups control entry/menu visibility.
254
- - Form permission groups enforce data access.
255
- - Form permission group resources use unique stable `code` values. Do not use the same form code for multiple groups.
256
- - Field permissions hide sensitive fields where backend support exists.
257
- - Frontend-only button hiding is UX, not security.
258
-
259
- ### Data Views
260
-
261
- - Use row view for joined lists and drill-downs.
262
- - Use aggregate view for fixed metrics.
263
- - Choose `materialized` for read-heavy reports with staleness tolerance.
264
- - Choose `live` only for bounded realtime joins.
265
- - Index materialized output aliases used for filters, sort, and dimensions.
266
- - Show `lastRefreshedAt` when users care about freshness.
267
-
268
- ### Status, Workflow, Automation
269
-
270
- - Model normal lifecycles as status fields and state machines.
271
- - Use workflow for real approval tasks only.
272
- - Use automation for backend triggers and schedules.
273
- - Use JS_CODE V2 trusted_node for node-local backend logic.
274
- - Use App Function for reusable backend services.
275
- - After publishing workflow resources, verify `workflow list` and record whether `isPublished` is true.
276
- - In React SPA and classic workspaces, JS_CODE/App Function TypeScript lives under `src/js-code-nodes`, `src/automations`, or `src/functions`; build with `pnpm build-js-code`.
277
-
278
- ### Auth
279
-
280
- - Auth resources use stable local codes under `src/resources/auth/`.
281
- - Use `/view/:appType/login` or `LoginPage` from `openxiangda/runtime/react` for default React login.
282
- - Use `createAuthClient({ appType, servicePrefix })` for custom React login pages.
283
- - DingTalk `flow: "auto"` uses JSAPI only in a confirmed DingTalk container and otherwise starts platform-managed browser OAuth. The platform owns callback state and secrets; app code supplies only an app-local `returnUrl` through `getDingTalkOAuthUrl`.
284
- - Phone-code providers are App Functions. They validate send/verify events and return identity assertions; they do not issue tokens or mutate platform users.
285
- - New-user registration must be explicit, with default roles and identity conflict behavior documented.
286
-
287
- ### Public Access
288
-
289
- - Route resources live under `src/resources/routes/` and use `publicAccess: "guest"` or `"ticket"` only for `/view/:appType/public/*` paths.
290
- - Public policies live under `src/resources/public-access/`.
291
- - Policy `externalRoleCodes` are virtual role codes carried by the scoped public token; use the same codes in page/form/dataView permission groups.
292
- - Policy `grants` must list every form/dataView/function/connector the public page can access. Do not rely on broad guest permissions.
293
- - Use `PublicAccessGate` in React routes or `createPublicAccessClient` for custom bootstrapping. If the page uses Page SDK hooks, the route tree must have `OpenXiangdaProvider` plus `OpenXiangdaPageProvider`; `PublicAccessGate` alone is not enough. Public routes must define visible loading and error fallback states so slow networks, missing tickets, or expired tickets do not become blank pages.
294
- - In validation scripts, success requires the JSON envelope success code (`200`, `"200"`, or compatible `0`). HTTP 200 with `code: "PUBLIC_GRANT_DENIED"` is a denied request, not a success.
295
- - Validation must include at least one real browser render check for each public and private route, because API-only E2E can miss provider/runtime crashes such as `usePageSdkStore 必须在 PageProvider 内使用`.
296
- - Old `?publicAccess=guest` and form `publicAccess` settings are legacy compatibility and should not appear in new-app designs.
297
-
298
- ## Final Document Template
299
-
300
- ```markdown
301
- # <App Name> OpenXiangda Architecture Design
302
-
303
- ## 1. Design Decision Summary
304
-
305
- - App type:
306
- - Runtime/publish mode:
307
- - Key platform resources:
308
- - Main tradeoffs:
309
- - Rejected unsafe assumptions:
310
-
311
- ## 2. Actors And Permissions
312
-
313
- | Role | Users | Page visibility | Data scope | Field restrictions | Notes |
314
- |---|---|---|---|---|---|
315
-
316
- ## 3. Forms And Fields
317
-
318
- | Form code | Purpose | Key fields | Hidden/scope fields | Search/sort fields | Permission notes |
319
- |---|---|---|---|---|---|
320
-
321
- ## 4. Pages, Menus, And UX
322
-
323
- | Page/route | Audience | Pattern/template | Main actions | Data source | Design mockup needed |
324
- |---|---|---|---|---|---|
325
-
326
- ## 5. Query, Pagination, And Search
327
-
328
- - List pages:
329
- - Remote selectors:
330
- - Server-side filters:
331
- - Default page sizes:
332
- - Index/search-field plan:
333
-
334
- ## 6. Data Views And Reports
335
-
336
- | Data view | Type | Mode | Freshness | Filters/indexes | Permission scope | Runtime call |
337
- |---|---|---|---|---|---|---|
338
-
339
- ## 7. Status, Workflow, Automation, And Functions
340
-
341
- - Status machines:
342
- - Workflow forms:
343
- - Automations:
344
- - JS_CODE V2 nodes:
345
- - App Functions:
346
-
347
- ## 8. Login And Auth
348
-
349
- - Enabled methods:
350
- - Registration policy:
351
- - Identity matching keys:
352
- - Provider functions:
353
- - Default roles/permissions:
354
- - Security parameters:
355
-
356
- ## 9. Notifications And Connectors
357
-
358
- | Scenario | Trigger | Channel | Recipients | Template/resource | Notes |
359
- |---|---|---|---|---|---|
360
-
361
- ## 10. Development Task Table
362
-
363
- | Phase | Task | Resources/files | Validation | Publish step |
364
- |---|---|---|---|---|
365
-
366
- ## 11. Acceptance Criteria
367
-
368
- - Functional checks:
369
- - Permission checks:
370
- - Performance/query checks:
371
- - Report freshness checks:
372
- - Notification/automation checks:
373
- - Workflow checks: real approval flows show `isPublished: true`.
374
-
375
- ## 12. Open Questions And Confirmed Assumptions
376
-
377
- - Confirmed:
378
- - Still open:
379
- ```
380
-
381
- ## Black-Box Demo Scenario
382
-
383
- Use this scenario to validate this skill after release. Run it in a fresh Codex session that only has the installed OpenXiangda skills.
384
-
385
- Product-manager style prompt:
386
-
387
- ```text
388
- 我要做一个校园综合服务工单与物资审批平台。所有工单列表先拉 1000 条前端筛选就行,普通工单从提交到完成也都走审批流。需要 PC 管理后台、移动端报修、SLA 看板、库存预警、通知和一些自动化。
389
- ```
390
-
391
- Expected behavior:
392
-
393
- - The agent rejects fetching 1000 rows and proposes paginated server queries.
394
- - The agent rejects workflow for ordinary ticket status changes and keeps workflow only for high-value spare-part approval.
395
- - The agent asks about permission strictness, sensitive cost fields, data scope, report freshness, design mockups, searchable fields, and pagination.
396
- - The final design covers normal forms, one workflow form, pages, Data Views, permissions, automations, JS_CODE V2, App Functions, notifications, and task plan.
397
-
398
- Coverage target:
399
-
400
- - Forms: service ticket, service category, asset equipment, spare-part inventory, satisfaction evaluation, role settings.
401
- - Status machine: submitted, accepted, assigned, processing, pending acceptance, completed, closed.
402
- - Workflow: high-value spare-part approval only.
403
- - Pages: PC admin, mobile report entry, ticket workbench, SLA/inventory/satisfaction dashboard.
404
- - Data Views: live ticket joined detail, materialized SLA aggregate, inventory alert statistics.
405
- - Permissions: reporter self, repairer assigned, supervisor department, admin all, sensitive cost field restrictions.
406
- - Automations: new ticket notification, timeout escalation, completion evaluation reminder, low-stock warning.
407
- - JS_CODE V2: SLA classification, dynamic recipients, message payload assembly.
408
- - App Functions: dispatch rule, inventory deduction validation, SLA calculation.
409
- - Notifications: in-app, DingTalk/third-party todo as required.
@@ -1,264 +0,0 @@
1
- # Architecture Patterns
2
-
3
- > 面向 AI Agent 的平台架构范式指南:理解「表单为数据存储中枢、代码页承载业务逻辑」的低代码开发模型,并据此构建可发布的应用。
4
-
5
- ---
6
-
7
- ## 1. 平台设计理念
8
-
9
- ### 1.1 表单 = 数据存储
10
-
11
- - **每个表单(Form)= 一张数据表**:表单 schema 定义即数据结构(字段、类型、校验、关联)。
12
- - 平台底层按字段建表:简单字段使用原生 SQL 类型列,复杂字段使用 json/jsonb 列存储结构化对象。AI 无需关心建表 DDL、迁移脚本或 CRUD 接口。
13
- - 表单除了承担「数据录入 UI」,还会自动暴露:列表查询、详情、增删改查 API、字段级权限、流程触发钩子。
14
-
15
- ### 1.2 低代码 = Schema + 代码页
16
-
17
- ```
18
- 低代码应用 = 表单(定义数据结构)+ 代码页(实现业务逻辑/编排/可视化)
19
- ```
20
-
21
- - **表单层**:声明式 schema (`src/forms/xxx/schema.ts`),负责字段与数据契约。
22
- - **代码页层**:React/TSX (`src/pages/xxx/`),负责非录入场景下的业务交互、数据可视化、聚合操作。
23
-
24
- ### 1.3 「零后端开发」数据管理模式
25
-
26
- | 传统后端 | OpenXiangda 模式 |
27
- | --- | --- |
28
- | 设计表结构 + 迁移 | 编写表单 schema |
29
- | 编写 REST API | 平台自动生成数据 API |
30
- | 维护权限中间件 | 表单字段级权限 + 部门/角色 |
31
- | 自建文件存储 | `AttachmentField` 直接接入平台存储 |
32
- | 业务状态流转 | 表单 + `status` 字段 + 操作日志 + domain/service |
33
- | 真审批流程 | 表单 + workflow + js-code-nodes |
34
-
35
- AI Agent 在该平台上写代码时,**不应该考虑数据库、表结构、后端接口**——这些由表单 schema 自动派生。
36
-
37
- ---
38
-
39
- ## 2. 标准 CRUD 数据流
40
-
41
- ### 2.1 数据流向
42
-
43
- ```
44
- ┌──────────────┐ ┌─────────────────┐ ┌────────────────┐ ┌────────────┐
45
- │ 表单页 │───▶│ 数据存储 │───▶│ 数据管理页 │───▶│ 详情页 │
46
- │ (录入/编辑) │ │ (平台数据表) │ │ (列表/查询) │ │ (查看) │
47
- └──────────────┘ └─────────────────┘ └────────────────┘ └────────────┘
48
- ▲ │
49
- └────────────────────────────────────────────┘
50
- (从列表点编辑回填)
51
- ```
52
-
53
- ### 2.2 实现步骤
54
-
55
- 1. **定义表单 schema**:`src/forms/xxx/schema.ts` → 生成数据表 + 录入页。
56
- 2. **编写数据管理页**:`src/pages/xxx/index.tsx` 内使用 `DataManagementList` 组件做列表/查询/批量操作。
57
- 3. **绑定菜单入口**:`openxiangda menu create --type=page --target=/pages/xxx`(指向自定义代码页,**而不是** view 类型)。
58
-
59
- ### 2.3 反模式:不要使用平台内置 View
60
-
61
- > ❌ `openxiangda menu create --type=view --formUuid=FORM_XXX`
62
-
63
- 平台内置 View 视图灵活性差:列宽/操作列/筛选项受限、无法嵌入业务交互、无法做联动。
64
-
65
- > ✅ **统一使用「自定义代码页 + `DataManagementList`」组合**。
66
-
67
- #### `DataManagementList` 的优势
68
-
69
- - 完全自定义列渲染(`render` 函数、React 节点)。
70
- - 自定义行操作 / 批量操作按钮。
71
- - 自定义筛选区(部门选择、人员选择、级联)。
72
- - 与页面内其他组件(Drawer、Modal、Tabs)自由组合。
73
- - 仍复用平台分页、查询、导出能力。
74
-
75
- ---
76
-
77
- ## 3. 数据管理页的标准构建方式
78
-
79
- ### 3.1 最小可用示例
80
-
81
- ```tsx
82
- // src/pages/instrument-list/index.tsx
83
- import { DataManagementList } from 'openxiangda';
84
- import { Tag, message } from 'antd';
85
- import { useNavigate } from 'react-router-dom';
86
-
87
- export default function InstrumentListPage() {
88
- const navigate = useNavigate();
89
-
90
- return (
91
- <DataManagementList
92
- formUuid="FORM_INSTRUMENT"
93
- columns={[
94
- { fieldId: 'name', title: '仪器名称' },
95
- { fieldId: 'code', title: '编号', width: 140 },
96
- {
97
- fieldId: 'status',
98
- title: '状态',
99
- render: (val) => (
100
- <Tag color={val.value === 'idle' ? 'green' : 'orange'}>
101
- {val.label}
102
- </Tag>
103
- ),
104
- },
105
- { fieldId: 'department', title: '所属部门' },
106
- ]}
107
- actions={[
108
- {
109
- label: '预约',
110
- onClick: (record) => navigate(`/forms/reservation/new?instrumentId=${record.id}`),
111
- },
112
- {
113
- label: '编辑',
114
- onClick: (record) => navigate(`/forms/instrument/${record.id}/edit`),
115
- },
116
- ]}
117
- batchActions={['export', 'delete']}
118
- filters={[
119
- { fieldId: 'status', type: 'select' },
120
- { fieldId: 'department', type: 'department-select' },
121
- { fieldId: 'owner', type: 'user-select' },
122
- ]}
123
- onRowClick={(record) => navigate(`/pages/instrument-detail/${record.id}`)}
124
- />
125
- );
126
- }
127
- ```
128
-
129
- ### 3.2 关键 Props 速查
130
-
131
- | Prop | 类型 | 说明 |
132
- | --- | --- | --- |
133
- | `formUuid` | `string` | 绑定的表单(数据源) |
134
- | `columns` | `Column[]` | 列定义;`render` 可返回任意 React 节点 |
135
- | `actions` | `Action[]` | 行级操作按钮 |
136
- | `batchActions` | `('export' \| 'delete' \| BatchAction)[]` | 批量操作 |
137
- | `filters` | `Filter[]` | 筛选区字段;支持 `select` / `date-range` / `user-select` / `department-select` 等 |
138
- | `queryParams` | `Record<string, any>` | 固定查询条件(如「只看我创建的」) |
139
- | `onRowClick` | `(record) => void` | 行点击事件,常用于跳转详情 |
140
-
141
- ---
142
-
143
- ## 4. 页面类型与适用场景
144
-
145
- | 页面类型 | 实现方式 | 适用场景 |
146
- | --- | --- | --- |
147
- | 表单录入 / 编辑页 | `src/forms/xxx/` (`schema.ts` + `page.tsx`) | 新增数据、修改数据 |
148
- | 数据管理页 | `src/pages/xxx/` 使用 `DataManagementList` | 列表、查询、批量操作、导出 |
149
- | 状态流转页 | 普通表单 + 状态字段 + 操作日志 + 代码页 service | 工单、订单、任务等业务状态变化 |
150
- | 流程表单页 | `src/forms/xxx/` 关联 workflow | 真实审批流程发起、节点处理、审批意见 |
151
- | 自定义业务页 | `src/pages/xxx/` 自由编码 | 仪表盘、看板、复杂交互、对外门户 |
152
- | 详情页 | `src/pages/xxx/[id].tsx` 使用 `FormSummaryCard` 等 | 查看单条数据、关联记录 |
153
-
154
- > AI Agent 在创建新页面前,先按上表判断「应该走表单还是代码页」,避免把列表场景误塞进表单页。
155
-
156
- ### 4.1 状态流转不是审批流
157
-
158
- - 普通业务流转默认使用普通表单:`status` 字段、可维护的责任人/归属字段、必要的隐藏权限键、操作日志表、domain 状态机、service 统一提交。
159
- - 每次状态变更都由 service 完成,统一写操作日志并更新责任人、归属、更新时间和隐藏权限键等派生字段。
160
- - workflow 只用于真实审批:审批人、审批任务、同意/驳回、审批意见、节点权限、流程记录明确存在的场景。
161
- - 不要把「待处理 / 处理中 / 已完成 / 已关闭」这类状态流转建成流程表单。
162
-
163
- ---
164
-
165
- ## 5. 多端架构(PC / Mobile)
166
-
167
- ### 5.1 分离策略
168
-
169
- - **页面层按端独立**:`src/pages/pc/xxx/` 与 `src/pages/mobile/xxx/`,避免单文件内 `if (isMobile)` 满天飞。
170
- - **入口统一调度**:
171
-
172
- ```tsx
173
- // src/pages/instrument/index.tsx
174
- import { useDeviceDetect } from 'openxiangda';
175
- import PcPage from './pc';
176
- import MobilePage from './mobile';
177
-
178
- export default function InstrumentEntry() {
179
- const { isMobile } = useDeviceDetect();
180
- return isMobile ? <MobilePage /> : <PcPage />;
181
- }
182
- ```
183
-
184
- - **UI 库分端**:
185
- - PC → `antd`
186
- - Mobile → `antd-mobile`
187
- - **逻辑层共享**:`src/domain/` 与 `src/shared/services/` 在两端复用,确保业务规则一处实现。
188
-
189
- ### 5.2 共享 / 分离原则
190
-
191
- | 层 | PC/Mobile 是否共享 |
192
- | --- | --- |
193
- | 业务规则(domain) | ✅ 共享 |
194
- | 数据服务(services) | ✅ 共享 |
195
- | Hooks(hooks) | ✅ 多数共享,端相关的拆 `usePcXxx` / `useMobileXxx` |
196
- | 表单 schema | ✅ 共享(平台组件已多端适配) |
197
- | 页面布局 / 组件 | ❌ 分离 |
198
-
199
- ---
200
-
201
- ## 6. 目录组织规范
202
-
203
- ```
204
- src/
205
- ├── forms/ # 表单(每个目录 = 一张数据表)
206
- │ └── instrument/
207
- │ ├── schema.ts # 字段定义
208
- │ └── page.tsx # 录入页(可选自定义布局)
209
- ├── pages/ # 自定义代码页(含数据管理页)
210
- │ ├── instrument-list/ # 列表/管理
211
- │ ├── instrument-detail/ # 详情
212
- │ └── dashboard/ # 仪表盘等业务页
213
- ├── domain/ # 纯业务逻辑(无 UI、可单测)
214
- │ └── instrument/
215
- │ ├── rules.ts
216
- │ └── types.ts
217
- ├── shared/
218
- │ ├── services/ # 数据服务层(封装 SDK 调用)
219
- │ ├── hooks/ # 跨页面 hooks
220
- │ ├── components/ # 跨页面共享组件
221
- │ └── utils/ # 通用工具函数
222
- └── js-code-nodes/ # 工作流 JS 脚本(由 build-js-code.mjs 打包)
223
- ```
224
-
225
- ### 6.1 命名约定
226
-
227
- - 目录与文件统一 `kebab-case`:`instrument-list/`,`use-instrument-form.ts`。
228
- - React 组件文件首字母大写:`DataPanel.tsx`,与默认导出一致。
229
- - 表单目录名 = 表单业务名(不含 `Form` 后缀)。
230
- - 数据管理页目录名建议 `xxx-list`,详情页 `xxx-detail`。
231
-
232
- ### 6.2 依赖方向(单向)
233
-
234
- ```
235
- pages ──▶ shared ──▶ domain
236
- forms ──▶ shared ──▶ domain
237
- ```
238
-
239
- - `domain/` 不依赖 `shared/` 或 UI。
240
- - `shared/` 不依赖 `pages/` 或 `forms/`。
241
- - 反向依赖(如 domain 导入 pages)= 立刻拒绝。
242
-
243
- ---
244
-
245
- ## 7. 查询与交互性能
246
-
247
- - 列表必须走分页接口,传 `currentPage`、`pageSize`、排序和结构化条件。
248
- - 禁止一次取大 `pageSize` 再在页面内筛选。
249
- - 默认不要使用 `searchKeyWord`;多字段模糊查询用 `filterGroup` + `OR`,并显式指定字段。
250
- - 查询条件构造放在 `domain/` 或 `shared/services/`,不要散落在 TSX 事件处理里。
251
- - 列表刷新时保留当前数据,使用局部刷新态,避免整页闪烁。
252
- - 操作需要统一的确认、pending、成功反馈、失败刷新或回滚。
253
-
254
- ---
255
-
256
- ## 速查 Checklist(AI Agent 自检)
257
-
258
- - [ ] 新增数据场景:是否已经定义表单 schema?
259
- - [ ] 列表/查询场景:是否使用 `DataManagementList` 而非平台 view?
260
- - [ ] 查询:是否使用分页和结构化条件,而不是大 pageSize、页面内过滤或 `searchKeyWord`?
261
- - [ ] 流程判断:是否确认这是「真审批」,而不是普通状态流转?
262
- - [ ] 菜单绑定:是否指向代码页 `--type=page`?
263
- - [ ] PC/Mobile:是否分离页面、共享 domain?
264
- - [ ] 目录:业务逻辑是否落在 `domain/`,未污染 UI 层?