vome-core 0.0.9 → 0.0.11

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 (198) hide show
  1. package/dist/admin/api/client.d.ts +32 -0
  2. package/dist/admin/api/client.js +1 -0
  3. package/dist/admin/config/plugin-dev.d.ts +30 -0
  4. package/dist/admin/config/plugin-dev.js +1 -0
  5. package/dist/admin/crud/config.d.ts +5 -0
  6. package/dist/admin/crud/config.js +1 -0
  7. package/dist/admin/crud/confirm.d.ts +11 -0
  8. package/dist/admin/crud/confirm.js +1 -0
  9. package/dist/admin/crud/dict.d.ts +3 -0
  10. package/dist/admin/crud/dict.js +1 -0
  11. package/dist/admin/crud/index.d.ts +40 -0
  12. package/dist/admin/crud/index.js +1 -0
  13. package/dist/admin/crud/key.d.ts +22 -0
  14. package/dist/admin/crud/key.js +1 -0
  15. package/dist/admin/crud/mitt.d.ts +10 -0
  16. package/dist/admin/crud/mitt.js +1 -0
  17. package/dist/admin/crud/plugins.d.ts +48 -0
  18. package/dist/admin/crud/plugins.js +1 -0
  19. package/dist/admin/crud/registry.d.ts +5 -0
  20. package/dist/admin/crud/registry.js +26 -0
  21. package/dist/admin/crud/span.d.ts +17 -0
  22. package/dist/admin/crud/span.js +1 -0
  23. package/dist/admin/crud/style.d.ts +36 -0
  24. package/dist/admin/crud/style.js +1 -0
  25. package/dist/admin/crud/useCrud.d.ts +18 -0
  26. package/dist/admin/crud/useCrud.js +1 -0
  27. package/dist/admin/crud/validate.d.ts +14 -0
  28. package/dist/admin/crud/validate.js +1 -0
  29. package/dist/admin/directives/perm.d.ts +3 -0
  30. package/dist/admin/directives/perm.js +1 -0
  31. package/dist/admin/hooks/useBrowser.d.ts +5 -0
  32. package/dist/admin/hooks/useBrowser.js +1 -0
  33. package/dist/admin/hooks/useUpload.d.ts +8 -0
  34. package/dist/admin/hooks/useUpload.js +1 -0
  35. package/dist/admin/hooks/useVome.d.ts +8 -0
  36. package/dist/admin/hooks/useVome.js +1 -0
  37. package/dist/admin/index.d.ts +26 -0
  38. package/dist/admin/index.js +1 -0
  39. package/dist/admin/lib/browser.d.ts +3 -0
  40. package/dist/admin/lib/browser.js +1 -0
  41. package/dist/admin/lib/cn.d.ts +2 -0
  42. package/dist/admin/lib/cn.js +1 -0
  43. package/dist/admin/lib/dialog-float.d.ts +4 -0
  44. package/dist/admin/lib/dialog-float.js +1 -0
  45. package/dist/admin/lib/eps.d.ts +11 -0
  46. package/dist/admin/lib/eps.js +1 -0
  47. package/dist/admin/lib/menu.d.ts +2 -0
  48. package/dist/admin/lib/menu.js +1 -0
  49. package/dist/admin/lib/module.d.ts +21 -0
  50. package/dist/admin/lib/module.js +1 -0
  51. package/dist/admin/lib/tree.d.ts +2 -0
  52. package/dist/admin/lib/tree.js +1 -0
  53. package/dist/admin/lib/upload.d.ts +13 -0
  54. package/dist/admin/lib/upload.js +1 -0
  55. package/dist/admin/router/index.d.ts +3 -0
  56. package/dist/admin/router/index.js +1 -0
  57. package/dist/admin/router/menu-routes.d.ts +7 -0
  58. package/dist/admin/router/menu-routes.js +1 -0
  59. package/dist/admin/service/base.d.ts +27 -0
  60. package/dist/admin/service/base.js +1 -0
  61. package/dist/admin/service/index.d.ts +15 -0
  62. package/dist/admin/service/index.js +1 -0
  63. package/dist/admin/stores/app.d.ts +1 -0
  64. package/dist/admin/stores/app.js +1 -0
  65. package/dist/admin/stores/tags.d.ts +1 -0
  66. package/dist/admin/stores/tags.js +1 -0
  67. package/dist/admin/stores/user.d.ts +1 -0
  68. package/dist/admin/stores/user.js +1 -0
  69. package/dist/index.d.ts +1 -1
  70. package/dist/index.js +1 -236
  71. package/dist/server/index.d.ts +1 -1
  72. package/dist/server/index.js +1 -3261
  73. package/dist/shared/index.js +1 -0
  74. package/dist/shared/tree.d.ts +18 -0
  75. package/dist/shared/tree.js +1 -0
  76. package/package.json +13 -10
  77. package/src/shared/tree.d.ts +18 -0
  78. package/typings/admin/base/auth.d.ts +20 -0
  79. package/typings/admin/base/permission.d.ts +19 -0
  80. package/typings/admin/comm/crud.d.ts +282 -0
  81. package/typings/admin/comm/request.d.ts +11 -0
  82. package/typings/admin/comm/service.d.ts +40 -0
  83. package/typings/admin/comm/upload.d.ts +26 -0
  84. package/typings/admin/vome/browser.d.ts +10 -0
  85. package/typings/admin/vome/module.d.ts +13 -0
  86. package/src/admin/api/client.ts +0 -184
  87. package/src/admin/config/plugin-dev.ts +0 -31
  88. package/src/admin/crud/config.ts +0 -38
  89. package/src/admin/crud/confirm.ts +0 -135
  90. package/src/admin/crud/dict.ts +0 -49
  91. package/src/admin/crud/index.ts +0 -79
  92. package/src/admin/crud/key.ts +0 -47
  93. package/src/admin/crud/mitt.ts +0 -27
  94. package/src/admin/crud/plugins.ts +0 -298
  95. package/src/admin/crud/registry.ts +0 -45
  96. package/src/admin/crud/span.ts +0 -48
  97. package/src/admin/crud/style.ts +0 -112
  98. package/src/admin/crud/useCrud.ts +0 -81
  99. package/src/admin/crud/validate.ts +0 -109
  100. package/src/admin/directives/perm.ts +0 -18
  101. package/src/admin/hooks/useBrowser.ts +0 -27
  102. package/src/admin/hooks/useUpload.ts +0 -82
  103. package/src/admin/hooks/useVome.ts +0 -13
  104. package/src/admin/index.ts +0 -59
  105. package/src/admin/lib/browser.ts +0 -28
  106. package/src/admin/lib/cn.ts +0 -7
  107. package/src/admin/lib/dialog-float.ts +0 -14
  108. package/src/admin/lib/eps.ts +0 -44
  109. package/src/admin/lib/menu.ts +0 -14
  110. package/src/admin/lib/module.ts +0 -112
  111. package/src/admin/lib/tree.ts +0 -2
  112. package/src/admin/lib/upload.ts +0 -102
  113. package/src/admin/router/index.ts +0 -68
  114. package/src/admin/router/menu-routes.ts +0 -126
  115. package/src/admin/service/base.ts +0 -96
  116. package/src/admin/service/index.ts +0 -413
  117. package/src/admin/stores/app.ts +0 -30
  118. package/src/admin/stores/tags.ts +0 -73
  119. package/src/admin/stores/user.ts +0 -52
  120. /package/{src → dist}/admin/components/vm-aside.vue +0 -0
  121. /package/{src → dist}/admin/components/vm-auto-perm-dialog.vue +0 -0
  122. /package/{src → dist}/admin/components/vm-check-tree.vue +0 -0
  123. /package/{src → dist}/admin/components/vm-dept-tree.vue +0 -0
  124. /package/{src → dist}/admin/components/vm-empty.vue +0 -0
  125. /package/{src → dist}/admin/components/vm-eps-perm-picker.vue +0 -0
  126. /package/{src → dist}/admin/components/vm-group-cascader.vue +0 -0
  127. /package/{src → dist}/admin/components/vm-icon-picker.vue +0 -0
  128. /package/{src → dist}/admin/components/vm-markdown.vue +0 -0
  129. /package/{src → dist}/admin/components/vm-ri-icon.vue +0 -0
  130. /package/{src → dist}/admin/components/vm-role-picker.vue +0 -0
  131. /package/{src → dist}/admin/components/vm-view-path-picker.vue +0 -0
  132. /package/{src → dist}/admin/crud/components/vm-column-custom.vue +0 -0
  133. /package/{src → dist}/admin/crud/components/vm-context-menu.vue +0 -0
  134. /package/{src → dist}/admin/crud/components/vm-date-picker.vue +0 -0
  135. /package/{src → dist}/admin/crud/components/vm-date-range.vue +0 -0
  136. /package/{src → dist}/admin/crud/components/vm-date-text.vue +0 -0
  137. /package/{src → dist}/admin/crud/components/vm-dict-tag.vue +0 -0
  138. /package/{src → dist}/admin/crud/components/vm-file-icon.vue +0 -0
  139. /package/{src → dist}/admin/crud/components/vm-multi-select.vue +0 -0
  140. /package/{src → dist}/admin/crud/components/vm-number-range.vue +0 -0
  141. /package/{src → dist}/admin/crud/components/vm-radio.vue +0 -0
  142. /package/{src → dist}/admin/crud/components/vm-select.vue +0 -0
  143. /package/{src → dist}/admin/crud/components/vm-switch.vue +0 -0
  144. /package/{src → dist}/admin/crud/components/vm-tree-select.vue +0 -0
  145. /package/{src → dist}/admin/crud/components/vm-upload-item.vue +0 -0
  146. /package/{src → dist}/admin/crud/components/vm-upload.vue +0 -0
  147. /package/{src → dist}/admin/crud/components/vm-user-select.vue +0 -0
  148. /package/{src → dist}/admin/crud/vm-add-btn.vue +0 -0
  149. /package/{src → dist}/admin/crud/vm-adv-search.vue +0 -0
  150. /package/{src → dist}/admin/crud/vm-crud.vue +0 -0
  151. /package/{src → dist}/admin/crud/vm-dialog.vue +0 -0
  152. /package/{src → dist}/admin/crud/vm-flex1.vue +0 -0
  153. /package/{src → dist}/admin/crud/vm-form.vue +0 -0
  154. /package/{src → dist}/admin/crud/vm-multi-delete-btn.vue +0 -0
  155. /package/{src → dist}/admin/crud/vm-pagination.vue +0 -0
  156. /package/{src → dist}/admin/crud/vm-refresh-btn.vue +0 -0
  157. /package/{src → dist}/admin/crud/vm-row.vue +0 -0
  158. /package/{src → dist}/admin/crud/vm-search-key.vue +0 -0
  159. /package/{src → dist}/admin/crud/vm-search.vue +0 -0
  160. /package/{src → dist}/admin/crud/vm-table.vue +0 -0
  161. /package/{src → dist}/admin/crud/vm-toolbar.vue +0 -0
  162. /package/{src → dist}/admin/crud/vm-upsert.vue +0 -0
  163. /package/{src → dist}/admin/data/remixicon-all.json +0 -0
  164. /package/{src → dist}/admin/env.d.ts +0 -0
  165. /package/{src → dist}/admin/static/fileicon/demo.css +0 -0
  166. /package/{src → dist}/admin/static/fileicon/demo_index.html +0 -0
  167. /package/{src → dist}/admin/static/fileicon/iconfont.css +0 -0
  168. /package/{src → dist}/admin/static/fileicon/iconfont.js +0 -0
  169. /package/{src → dist}/admin/static/fileicon/iconfont.json +0 -0
  170. /package/{src → dist}/admin/static/fileicon/iconfont.ttf +0 -0
  171. /package/{src → dist}/admin/static/fileicon/iconfont.woff +0 -0
  172. /package/{src → dist}/admin/static/fileicon/iconfont.woff2 +0 -0
  173. /package/{src → dist}/admin/static/scarce//344/270/213/350/275/275/345/244/261/350/264/245.svg" +0 -0
  174. /package/{src → dist}/admin/static/scarce//346/224/257/344/273/230/346/210/220/345/212/237.svg" +0 -0
  175. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/344/274/230/346/203/240/345/210/270.svg" +0 -0
  176. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/206/205/345/256/271.svg" +0 -0
  177. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/217/221/347/245/250.svg" +0 -0
  178. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/233/276/347/211/207.svg" +0 -0
  179. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/234/260/345/235/200.svg" +0 -0
  180. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/272/227/351/223/272.svg" +0 -0
  181. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/216/250/351/200/201.svg" +0 -0
  182. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/220/234/347/264/242/347/273/223/346/236/234.svg" +0 -0
  183. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/224/266/350/227/217.svg" +0 -0
  184. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/225/260/346/215/256.svg" +0 -0
  185. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/235/203/351/231/220.svg" +0 -0
  186. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/266/210/346/201/257.svg" +0 -0
  187. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/347/244/274/347/211/251.svg" +0 -0
  188. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/347/247/257/345/210/206.svg" +0 -0
  189. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/347/275/221/347/273/234.svg" +0 -0
  190. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/350/247/206/351/242/221.svg" +0 -0
  191. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/350/256/242/345/215/225.svg" +0 -0
  192. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/350/257/204/350/256/272.svg" +0 -0
  193. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/351/205/215/351/200/201.svg" +0 -0
  194. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/351/223/266/350/241/214/345/215/241.svg" +0 -0
  195. /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/351/237/263/344/271/220.svg" +0 -0
  196. /package/{src → dist}/admin/static/scarce//351/241/265/351/235/242/344/270/215/345/255/230/345/234/250.svg" +0 -0
  197. /package/{src → dist}/admin/styles/base.css +0 -0
  198. /package/{src → dist}/admin/tsconfig.json +0 -0
@@ -0,0 +1 @@
1
+ (function(_0x2be0ab,_0x5deab1){var _0x587bf9=_0x5297,_0x16027f=_0x2be0ab();while(!![]){try{var _0x498ac5=-parseInt(_0x587bf9(0xfe))/0x1*(parseInt(_0x587bf9(0x101))/0x2)+-parseInt(_0x587bf9(0x103))/0x3+-parseInt(_0x587bf9(0xff))/0x4*(parseInt(_0x587bf9(0x102))/0x5)+-parseInt(_0x587bf9(0x105))/0x6+parseInt(_0x587bf9(0x106))/0x7+parseInt(_0x587bf9(0x104))/0x8+parseInt(_0x587bf9(0x100))/0x9;if(_0x498ac5===_0x5deab1)break;else _0x16027f['push'](_0x16027f['shift']());}catch(_0x392294){_0x16027f['push'](_0x16027f['shift']());}}}(_0x47c0,0x51c19));export{merge}from'../comm/merge';function _0x5297(_0x408b8a,_0x1288e7){_0x408b8a=_0x408b8a-0xfe;var _0x47c06b=_0x47c0();var _0x52971a=_0x47c06b[_0x408b8a];if(_0x5297['HOaCig']===undefined){var _0x1c2f3e=function(_0x4fd03f){var _0x5c7c18='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x18e524='',_0x1b0678='';for(var _0x14a067=0x0,_0x9a8427,_0x1e1ca1,_0x4c0d77=0x0;_0x1e1ca1=_0x4fd03f['charAt'](_0x4c0d77++);~_0x1e1ca1&&(_0x9a8427=_0x14a067%0x4?_0x9a8427*0x40+_0x1e1ca1:_0x1e1ca1,_0x14a067++%0x4)?_0x18e524+=String['fromCharCode'](0xff&_0x9a8427>>(-0x2*_0x14a067&0x6)):0x0){_0x1e1ca1=_0x5c7c18['indexOf'](_0x1e1ca1);}for(var _0x4ee82a=0x0,_0x34df95=_0x18e524['length'];_0x4ee82a<_0x34df95;_0x4ee82a++){_0x1b0678+='%'+('00'+_0x18e524['charCodeAt'](_0x4ee82a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1b0678);};_0x5297['cOLuIv']=_0x1c2f3e,_0x5297['qJWRAM']={},_0x5297['HOaCig']=!![];}var _0x5b792b=_0x47c06b[0x0],_0x5948dc=_0x408b8a+_0x5b792b,_0x1c5f25=_0x5297['qJWRAM'][_0x5948dc];return!_0x1c5f25?(_0x52971a=_0x5297['cOLuIv'](_0x52971a),_0x5297['qJWRAM'][_0x5948dc]=_0x52971a):_0x52971a=_0x1c5f25,_0x52971a;}export{deepTree,flattenTree}from'./tree';function _0x47c0(){var _0xdea108=['mtzpAKjLAwC','ntiZnZvJuwvdthu','mte0mdqXn1nPCenoqG','mZuWodiWmhLbzgzXAq','mtq4mtm5nhzuC1Lrvq','mJC4otaXn1zHvfvizq','mZyYodjku05czve','mJa0sxj5Auvv','odu0ndKYngnVC29kqW'];_0x47c0=function(){return _0xdea108;};return _0x47c0();}export{RES_CODE}from'../routing/base';
@@ -0,0 +1,18 @@
1
+ /** 扁平列表 → 树(parentId) */
2
+ export declare function deepTree<T extends {
3
+ id?: number | string;
4
+ parentId?: number | string | null;
5
+ children?: T[];
6
+ orderNum?: number;
7
+ }>(list: T[], sort?: 'asc' | 'desc'): T[];
8
+ /** 树 → 扁平(带 depth / hasChildren),按 expanded 展开 */
9
+ export declare function flattenTree<T extends {
10
+ id: number | string;
11
+ children?: T[];
12
+ }>(nodes: T[], expanded: Set<string | number>, depth?: number, out?: Array<T & {
13
+ depth: number;
14
+ hasChildren: boolean;
15
+ }>): Array<T & {
16
+ depth: number;
17
+ hasChildren: boolean;
18
+ }>;
@@ -0,0 +1 @@
1
+ function _0x5942(_0x4a5a98,_0x1afb31){_0x4a5a98=_0x4a5a98-0x102;const _0x23abfa=_0x23ab();let _0x594206=_0x23abfa[_0x4a5a98];if(_0x5942['mJsgfi']===undefined){var _0x3a6247=function(_0x56e275){const _0x10f855='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5eb0dc='',_0x5ce72d='';for(let _0x4ac1e2=0x0,_0x40b48e,_0x42ebe7,_0x3edd9e=0x0;_0x42ebe7=_0x56e275['charAt'](_0x3edd9e++);~_0x42ebe7&&(_0x40b48e=_0x4ac1e2%0x4?_0x40b48e*0x40+_0x42ebe7:_0x42ebe7,_0x4ac1e2++%0x4)?_0x5eb0dc+=String['fromCharCode'](0xff&_0x40b48e>>(-0x2*_0x4ac1e2&0x6)):0x0){_0x42ebe7=_0x10f855['indexOf'](_0x42ebe7);}for(let _0x396f3c=0x0,_0x21323d=_0x5eb0dc['length'];_0x396f3c<_0x21323d;_0x396f3c++){_0x5ce72d+='%'+('00'+_0x5eb0dc['charCodeAt'](_0x396f3c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5ce72d);};_0x5942['vwoXVt']=_0x3a6247,_0x5942['AeFvxC']={},_0x5942['mJsgfi']=!![];}const _0x4c6543=_0x23abfa[0x0],_0x23200e=_0x4a5a98+_0x4c6543,_0x36aa78=_0x5942['AeFvxC'][_0x23200e];return!_0x36aa78?(_0x594206=_0x5942['vwoXVt'](_0x594206),_0x5942['AeFvxC'][_0x23200e]=_0x594206):_0x594206=_0x36aa78,_0x594206;}function _0x23ab(){const _0x11b16b=['ChvZAa','ngjuB2H1Bq','ngXNALDhBa','CgfYzw50swq','AgfZ','C29YDa','nZC0odnytuXHyNu','nJq1mJeWzeLtuLnM','BgvUz3rO','y2HPBgrYzw4','mJa3B1ruyuHY','mZqYndK1tKX3ChHf','B3jKzxjoDw0','nLDrD1DksW','mJu5mJe2CgHwDxfT','DMfSDwvZ','mJm3mZC4yNfgAgHZ','mZK5odvKsKTgu04','z2v0','C2v0','mJGWnJe5mgLqthboyq'];_0x23ab=function(){return _0x11b16b;};return _0x23ab();}(function(_0x1929e7,_0x4a7107){const _0x57882d=_0x5942,_0x22af33=_0x1929e7();while(!![]){try{const _0x17c79d=-parseInt(_0x57882d(0x102))/0x1+-parseInt(_0x57882d(0x112))/0x2*(-parseInt(_0x57882d(0x10b))/0x3)+-parseInt(_0x57882d(0x111))/0x4*(-parseInt(_0x57882d(0x106))/0x5)+-parseInt(_0x57882d(0x108))/0x6*(parseInt(_0x57882d(0x116))/0x7)+-parseInt(_0x57882d(0x109))/0x8*(-parseInt(_0x57882d(0x105))/0x9)+parseInt(_0x57882d(0x10f))/0xa+parseInt(_0x57882d(0x10c))/0xb;if(_0x17c79d===_0x4a7107)break;else _0x22af33['push'](_0x22af33['shift']());}catch(_0x5594e5){_0x22af33['push'](_0x22af33['shift']());}}}(_0x23ab,0x927a4));export function deepTree(_0x5eb0dc,_0x5ce72d='asc'){const _0x54cc6c=_0x5942,_0x4ac1e2=new Map();for(const _0x3edd9e of _0x5eb0dc){if(_0x3edd9e['id']==null)continue;_0x4ac1e2[_0x54cc6c(0x10e)](_0x3edd9e['id'],{..._0x3edd9e,'children':[]});}const _0x40b48e=[];for(const _0x396f3c of _0x4ac1e2[_0x54cc6c(0x10a)]()){const _0x21323d=_0x396f3c[_0x54cc6c(0x113)];_0x21323d!=null&&_0x21323d!==''&&_0x4ac1e2[_0x54cc6c(0x114)](_0x21323d)?_0x4ac1e2[_0x54cc6c(0x10d)](_0x21323d)[_0x54cc6c(0x104)][_0x54cc6c(0x110)](_0x396f3c):_0x40b48e[_0x54cc6c(0x110)](_0x396f3c);}const _0x42ebe7=_0x42d0ed=>{const _0x2a139e=_0x54cc6c;_0x42d0ed[_0x2a139e(0x115)]((_0x46f3ce,_0x2cd25b)=>{const _0x53c05f=_0x2a139e,_0x3305a9=_0x46f3ce[_0x53c05f(0x107)]??0x0,_0x3888c6=_0x2cd25b[_0x53c05f(0x107)]??0x0,_0xc86bf8=_0x5ce72d==='desc'?_0x3888c6-_0x3305a9:_0x3305a9-_0x3888c6;return _0xc86bf8||Number(_0x46f3ce['id'])-Number(_0x2cd25b['id']);});for(const _0x35734e of _0x42d0ed)if(_0x35734e['children']?.[_0x2a139e(0x103)])_0x42ebe7(_0x35734e[_0x2a139e(0x104)]);};return _0x42ebe7(_0x40b48e),_0x40b48e;}export function flattenTree(_0x52628a,_0x2b02d1,_0x3ff434=0x0,_0x3c29b2=[]){const _0x31102b=_0x5942;for(const _0x25516c of _0x52628a){const _0x430fef=_0x25516c['children']||[];_0x3c29b2[_0x31102b(0x110)]({..._0x25516c,'depth':_0x3ff434,'hasChildren':_0x430fef['length']>0x0});if(_0x430fef[_0x31102b(0x103)]&&_0x2b02d1[_0x31102b(0x114)](_0x25516c['id']))flattenTree(_0x430fef,_0x2b02d1,_0x3ff434+0x1,_0x3c29b2);}return _0x3c29b2;}
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "vome-core",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Vome framework — shared + Bun/Elysia server + Vue admin",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",
9
- "src/admin",
10
9
  "src/shared",
11
10
  "typings/admin"
12
11
  ],
@@ -24,18 +23,22 @@
24
23
  "default": "./dist/server/index.js"
25
24
  },
26
25
  "./admin": {
27
- "types": "./src/admin/index.ts",
28
- "import": "./src/admin/index.ts",
29
- "default": "./src/admin/index.ts"
26
+ "types": "./dist/admin/index.d.ts",
27
+ "import": "./dist/admin/index.js",
28
+ "default": "./dist/admin/index.js"
30
29
  },
31
- "./admin/*": "./src/admin/*",
32
- "./admin/styles/base.css": "./src/admin/styles/base.css",
30
+ "./admin/*": "./dist/admin/*",
31
+ "./admin/styles/base.css": "./dist/admin/styles/base.css",
33
32
  "./typings/*": "./typings/admin/*"
34
33
  },
35
34
  "scripts": {
36
- "build": "rm -rf dist && bun build ./src/index.ts ./src/server/index.ts --outdir ./dist --target bun --format esm --external elysia --external reflect-metadata --external drizzle-orm --external drizzle-zod --external @elysiajs/openapi --external @bogeychan/elysia-logger --external pino --external pino-pretty && tsc -p tsconfig.build.json && printf \"%s\\n\" \"export * from '../src/index'\" > dist/index.d.ts && mkdir -p dist/server && printf \"%s\\n\" \"export * from '../../src/server/index'\" > dist/server/index.d.ts",
37
- "build:obfuscate": "rm -rf dist && bun build ./src/index.ts ./src/server/index.ts --outdir ./dist --target bun --format esm --minify --external elysia --external reflect-metadata --external drizzle-orm --external drizzle-zod --external @elysiajs/openapi --external @bogeychan/elysia-logger --external pino --external pino-pretty && tsc -p tsconfig.build.json && printf \"%s\\n\" \"export * from '../src/index'\" > dist/index.d.ts && mkdir -p dist/server && printf \"%s\\n\" \"export * from '../../src/server/index'\" > dist/server/index.d.ts && bun scripts/obfuscate.ts",
38
- "prepare": "bun run build"
35
+ "build:server": "bun build ./src/index.ts ./src/server/index.ts --outdir ./dist --target bun --format esm --external elysia --external reflect-metadata --external drizzle-orm --external drizzle-zod --external @elysiajs/openapi --external @bogeychan/elysia-logger --external pino --external pino-pretty && tsc -p tsconfig.build.json && printf \"%s\\n\" \"export * from './src/index'\" > dist/index.d.ts && mkdir -p dist/server && printf \"%s\\n\" \"export * from '../src/server/index'\" > dist/server/index.d.ts",
36
+ "build:admin": "bun scripts/build-admin.ts",
37
+ "build": "rm -rf dist && bun run build:server && bun run build:admin",
38
+ "obfuscate": "bun scripts/obfuscate.ts",
39
+ "build:obfuscate": "bun run build && bun run obfuscate",
40
+ "prepare": "bun run build:obfuscate",
41
+ "prepublishOnly": "bun run build:obfuscate"
39
42
  },
40
43
  "peerDependencies": {
41
44
  "elysia": ">=1.0.0",
@@ -0,0 +1,18 @@
1
+ /** 扁平列表 → 树(parentId) */
2
+ export declare function deepTree<T extends {
3
+ id?: number | string;
4
+ parentId?: number | string | null;
5
+ children?: T[];
6
+ orderNum?: number;
7
+ }>(list: T[], sort?: 'asc' | 'desc'): T[];
8
+ /** 树 → 扁平(带 depth / hasChildren),按 expanded 展开 */
9
+ export declare function flattenTree<T extends {
10
+ id: number | string;
11
+ children?: T[];
12
+ }>(nodes: T[], expanded: Set<string | number>, depth?: number, out?: Array<T & {
13
+ depth: number;
14
+ hasChildren: boolean;
15
+ }>): Array<T & {
16
+ depth: number;
17
+ hasChildren: boolean;
18
+ }>;
@@ -0,0 +1,20 @@
1
+ import type { MenuTreeNode } from './permission';
2
+ export type TokenPair = {
3
+ accessToken: string;
4
+ refreshToken: string;
5
+ };
6
+ export type AuthMe = {
7
+ adminId: number;
8
+ username?: string;
9
+ isSuper: boolean;
10
+ perms: string[];
11
+ tenantId?: number | null;
12
+ tenantEnabled?: boolean;
13
+ };
14
+ export type AuthPerms = {
15
+ isSuper: boolean;
16
+ perms: string[];
17
+ menus: MenuTreeNode[];
18
+ tenantEnabled?: boolean;
19
+ tenantId?: number | null;
20
+ };
@@ -0,0 +1,19 @@
1
+ /** 菜单节点 */
2
+ export type MenuTreeNode = {
3
+ id: number;
4
+ parentId: number | null;
5
+ name: string;
6
+ router: string | null;
7
+ perms: string | null;
8
+ type: number;
9
+ icon: string | null;
10
+ orderNum: number;
11
+ viewPath: string | null;
12
+ remoteName: string | null;
13
+ remoteEntry: string | null;
14
+ remoteModule: string | null;
15
+ appKey: string | null;
16
+ keepAlive: boolean;
17
+ isShow: boolean;
18
+ children?: MenuTreeNode[];
19
+ };
@@ -0,0 +1,282 @@
1
+ import type { Component, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
2
+ /** 标准 CRUD service */
3
+ export type CrudService = {
4
+ namespace?: string;
5
+ page?: (data: Record<string, unknown>) => Promise<{
6
+ list: Record<string, unknown>[];
7
+ pagination: {
8
+ page: number;
9
+ size: number;
10
+ total: number;
11
+ };
12
+ }>;
13
+ list?: (data?: Record<string, unknown>) => Promise<Record<string, unknown>[]>;
14
+ info?: (data: {
15
+ id: number | string;
16
+ }) => Promise<Record<string, unknown>>;
17
+ add?: (data: Record<string, unknown>) => Promise<unknown>;
18
+ update?: (data: Record<string, unknown>) => Promise<unknown>;
19
+ delete?: (data: {
20
+ ids: Array<number | string>;
21
+ force?: boolean;
22
+ }) => Promise<unknown>;
23
+ restore?: (data: {
24
+ ids: Array<number | string>;
25
+ }) => Promise<unknown>;
26
+ /** 权限码字符串 map */
27
+ permission?: Partial<CrudPermission> | Record<string, string>;
28
+ /** 当前用户是否具备对应权限 */
29
+ _permission?: Partial<CrudPermission> & Record<string, boolean>;
30
+ request?: (options?: any) => Promise<unknown>;
31
+ [key: string]: unknown;
32
+ };
33
+ export type CrudPermission = {
34
+ page: boolean;
35
+ list: boolean;
36
+ info: boolean;
37
+ add: boolean;
38
+ delete: boolean;
39
+ update: boolean;
40
+ };
41
+ export type CrudDict = {
42
+ primaryId: string;
43
+ api: {
44
+ list: string;
45
+ add: string;
46
+ update: string;
47
+ delete: string;
48
+ info: string;
49
+ page: string;
50
+ };
51
+ pagination: {
52
+ page: string;
53
+ size: string;
54
+ };
55
+ search: {
56
+ keyWord: string;
57
+ query: string;
58
+ };
59
+ sort: {
60
+ order: string;
61
+ prop: string;
62
+ };
63
+ label: Record<string, string>;
64
+ };
65
+ export type CrudFormComponent = {
66
+ name?: string | Component;
67
+ props?: Record<string, unknown>;
68
+ };
69
+ export type CrudSearchItem = {
70
+ prop: string;
71
+ label: string;
72
+ type?: 'input' | 'select' | 'date' | 'daterange' | 'number-range';
73
+ placeholder?: string;
74
+ options?: Array<{
75
+ label: string;
76
+ value: string | number | boolean;
77
+ }>;
78
+ /** 业务字典 type.key;有则拉 options */
79
+ dict?: string;
80
+ /** 下拉多选 */
81
+ multiple?: boolean;
82
+ /** 区间:提交时拆成 min/max 请求参数 */
83
+ range?: {
84
+ min: string;
85
+ max: string;
86
+ rangeType: 'int' | 'float' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second';
87
+ };
88
+ /** component.name 走 registry */
89
+ component?: CrudFormComponent;
90
+ };
91
+ export type CrudOpButton = 'edit' | 'delete' | 'info' | {
92
+ label: string;
93
+ hidden?: boolean;
94
+ variant?: 'softPrimary' | 'softDestructive' | 'softSuccess' | 'ghost' | 'outline';
95
+ onClick: (row: Record<string, unknown>) => void;
96
+ };
97
+ export type CrudColumn = {
98
+ prop?: string;
99
+ label?: string;
100
+ /** selection | index | op | expand */
101
+ type?: 'selection' | 'index' | 'op' | 'expand';
102
+ width?: string | number;
103
+ minWidth?: string | number;
104
+ align?: 'left' | 'center' | 'right';
105
+ hidden?: boolean;
106
+ /** true / custom 可点排序;asc|desc 表示默认方向 */
107
+ sortable?: boolean | 'custom' | 'asc' | 'desc' | 'ascending' | 'descending';
108
+ slot?: string;
109
+ formatter?: (row: Record<string, unknown>, value: unknown) => string;
110
+ /** op 列:edit/delete/info 或自定义按钮对象 */
111
+ buttons?: CrudOpButton[] | ((row: Record<string, unknown>) => CrudOpButton[]);
112
+ /** 单元格组件:name 为注册名或直接组件 */
113
+ component?: {
114
+ name?: string | Component;
115
+ props?: Record<string, unknown>;
116
+ };
117
+ /** dict.get / dict.options(支持 ComputedRef) */
118
+ dict?: MaybeRefOrGetter<Array<{
119
+ label: string;
120
+ value: string | number;
121
+ type?: string;
122
+ color?: string;
123
+ }>>;
124
+ children?: CrudColumn[];
125
+ };
126
+ export type CrudFormItem = {
127
+ prop: string;
128
+ label: string;
129
+ type?: 'input' | 'textarea' | 'select' | 'switch' | 'radio';
130
+ required?: boolean;
131
+ placeholder?: string;
132
+ /** 控件禁用 */
133
+ disabled?: boolean;
134
+ /** 扁平或树;options: dict.get('x') */
135
+ options?: MaybeRefOrGetter<Array<{
136
+ label: string;
137
+ value: string | number | boolean;
138
+ children?: Array<{
139
+ label: string;
140
+ value: string | number | boolean;
141
+ children?: unknown[];
142
+ }>;
143
+ }>>;
144
+ /** 按桌面 24 栅格配置(全宽 24);移动端自动映射到 12 列 */
145
+ span?: number;
146
+ hidden?: boolean | ((form: Record<string, unknown>) => boolean);
147
+ /** 用 component 描述控件 */
148
+ component?: CrudFormComponent;
149
+ value?: unknown;
150
+ rules?: unknown;
151
+ };
152
+ export type CrudTrashMode = 'default' | 'onlyTrashed' | 'withTrashed';
153
+ export type CrudRefreshHelpers = {
154
+ next: (params: Record<string, unknown>) => Promise<unknown>;
155
+ done: () => void;
156
+ render: (list: Record<string, unknown>[] | {
157
+ list: Record<string, unknown>[];
158
+ pagination?: unknown;
159
+ }, pagination?: {
160
+ page?: number;
161
+ size?: number;
162
+ total?: number;
163
+ }) => void;
164
+ };
165
+ export type CrudDeleteHelpers = {
166
+ next: (params?: Record<string, unknown>) => Promise<unknown>;
167
+ };
168
+ export type CrudOptions = {
169
+ /** service.base.user 或字符串路径 */
170
+ service: CrudService | string | any;
171
+ dict?: Partial<CrudDict>;
172
+ permission?: Partial<CrudPermission>;
173
+ onRefresh?: (params: Record<string, unknown>, helpers: CrudRefreshHelpers) => void | Promise<void>;
174
+ onDelete?: (selection: Record<string, unknown>[], helpers: CrudDeleteHelpers) => void | Promise<void>;
175
+ };
176
+ export type CrudUpsertOptions = {
177
+ items?: CrudFormItem[];
178
+ props?: Record<string, unknown>;
179
+ dialog?: {
180
+ title?: string;
181
+ /** 显式 false 强制隐藏确定;未设时仍按 info 模式自动隐藏 */
182
+ confirm?: boolean;
183
+ };
184
+ sync?: boolean;
185
+ onOpen?: (data: Record<string, unknown>) => void;
186
+ onOpened?: (data: Record<string, unknown>) => void;
187
+ onClose?: (action: 'close' | 'submit', done: () => void) => void;
188
+ onInfo?: (data: Record<string, unknown>, helpers: {
189
+ next: (data?: Record<string, unknown>) => Promise<Record<string, unknown>>;
190
+ done: (data: Record<string, unknown>) => void;
191
+ close: () => void;
192
+ }) => void | Promise<void>;
193
+ onSubmit?: (data: Record<string, unknown>, helpers: {
194
+ next: (data?: Record<string, unknown>) => Promise<unknown>;
195
+ done: () => void;
196
+ close: () => void;
197
+ }) => void | Promise<void | unknown>;
198
+ };
199
+ export type CrudTableOptions = {
200
+ columns?: CrudColumn[];
201
+ autoHeight?: boolean;
202
+ border?: boolean;
203
+ contextMenu?: boolean | string[];
204
+ rowKey?: string;
205
+ /** 树表:list 含 children 时缩进展开 */
206
+ tree?: boolean;
207
+ treeLazy?: boolean;
208
+ /** 默认排序;请求键由 dict.sort 决定 */
209
+ defaultSort?: {
210
+ prop: string;
211
+ order: 'asc' | 'desc' | 'ascending' | 'descending';
212
+ };
213
+ /** 排序变化时是否 refresh,默认 true */
214
+ sortRefresh?: boolean;
215
+ plugins?: unknown[];
216
+ };
217
+ export type CrudSearchOptions = {
218
+ items?: CrudSearchItem[];
219
+ };
220
+ export type CrudContext = {
221
+ service: CrudService;
222
+ loading: Ref<boolean>;
223
+ list: Ref<Record<string, unknown>[]>;
224
+ selection: Ref<Record<string, unknown>[]>;
225
+ pagination: Ref<{
226
+ page: number;
227
+ size: number;
228
+ total: number;
229
+ }>;
230
+ params: Ref<Record<string, unknown>>;
231
+ trashMode: Ref<CrudTrashMode>;
232
+ permission: Ref<CrudPermission>;
233
+ dict: CrudDict;
234
+ refresh: (extra?: Record<string, unknown>) => Promise<unknown>;
235
+ setParams: (p: Record<string, unknown>, doRefresh?: boolean) => void;
236
+ resetParams: () => void;
237
+ setSelection: (rows: Record<string, unknown>[]) => void;
238
+ getPermission: (key?: keyof CrudPermission) => boolean | CrudPermission;
239
+ getParams: () => Record<string, unknown>;
240
+ rowAdd: (defaults?: Record<string, unknown>) => void;
241
+ rowAppend: (data?: Record<string, unknown>) => void;
242
+ rowEdit: (row: Record<string, unknown>) => Promise<void>;
243
+ rowInfo: (row: Record<string, unknown>) => Promise<void>;
244
+ rowClose: () => void;
245
+ /** 打开 upsert,不校验 add 权限 */
246
+ openUpsert: (form?: Record<string, unknown>, mode?: 'add' | 'update' | 'info') => void;
247
+ rowDelete: (rows?: Record<string, unknown>[], force?: boolean) => Promise<void>;
248
+ rowRestore: (rows?: Record<string, unknown>[]) => Promise<void>;
249
+ upsertVisible: Ref<boolean>;
250
+ upsertMode: Ref<'add' | 'update' | 'info'>;
251
+ upsertForm: Ref<Record<string, unknown>>;
252
+ upsertSubmit: () => Promise<void>;
253
+ upsertClose: () => void;
254
+ patchUpsertForm: (patch: Record<string, unknown>) => void;
255
+ getUpsertForm: () => Record<string, unknown>;
256
+ /** vm-search 注册;vm-toolbar 搜索/重置读取 */
257
+ searchActions: import('vue').ShallowRef<{
258
+ search: () => void;
259
+ reset: () => void;
260
+ } | null>;
261
+ /** vm-search 是否有筛选项;无配置时不显示 toolbar 搜索/重置 */
262
+ hasSearchFilters: Ref<boolean>;
263
+ };
264
+ /** 表格右键菜单项 */
265
+ export type CtxMenuItem = {
266
+ key: string;
267
+ label: string;
268
+ disabled?: boolean;
269
+ };
270
+ /** 树形下拉选项 */
271
+ export type TreeSelectOption = {
272
+ label?: string;
273
+ value?: string | number | boolean;
274
+ children?: TreeSelectOption[];
275
+ [key: string]: unknown;
276
+ };
277
+ /** CRUD Table 插件标记 */
278
+ export type TablePlugin = {
279
+ __plugin: string;
280
+ [key: string]: unknown;
281
+ };
282
+ export type { InjectionKey, Ref };
@@ -0,0 +1,11 @@
1
+ export type ApiResult<T> = {
2
+ code: number;
3
+ message: string;
4
+ data: T;
5
+ };
6
+ export type RequestOptions = RequestInit & {
7
+ /** 失败时是否 toast,默认 true */
8
+ toast?: boolean;
9
+ /** 跳过自动 refresh */
10
+ skipRefresh?: boolean;
11
+ };
@@ -0,0 +1,40 @@
1
+ /** 链式 service 叶子节点 */
2
+ export type ServiceRequestOptions = {
3
+ url?: string;
4
+ method?: string;
5
+ data?: unknown;
6
+ params?: Record<string, unknown>;
7
+ };
8
+ export type ServiceLeaf = {
9
+ namespace: string;
10
+ permission: Record<string, string>;
11
+ _permission: Record<string, boolean>;
12
+ request: (options?: ServiceRequestOptions) => Promise<unknown>;
13
+ page?: (data?: Record<string, unknown>) => Promise<{
14
+ list: Record<string, unknown>[];
15
+ pagination: {
16
+ page: number;
17
+ size: number;
18
+ total: number;
19
+ };
20
+ }>;
21
+ list?: (data?: Record<string, unknown>) => Promise<Record<string, unknown>[]>;
22
+ info?: (data: {
23
+ id: number | string;
24
+ }) => Promise<Record<string, unknown>>;
25
+ add?: (data: Record<string, unknown>) => Promise<unknown>;
26
+ update?: (data: Record<string, unknown>) => Promise<unknown>;
27
+ delete?: (data: {
28
+ ids: Array<number | string>;
29
+ force?: boolean;
30
+ }) => Promise<unknown>;
31
+ restore?: (data: {
32
+ ids: Array<number | string>;
33
+ }) => Promise<unknown>;
34
+ [method: string]: unknown;
35
+ };
36
+ /** 嵌套树:service.base.user(动态键,运行时由 EPS 填充) */
37
+ export type ServiceTree = {
38
+ request: (options?: ServiceRequestOptions) => Promise<unknown>;
39
+ [key: string]: any;
40
+ };
@@ -0,0 +1,26 @@
1
+ export type UploadFileType = 'image' | 'video' | 'audio' | 'word' | 'excel' | 'ppt' | 'pdf' | 'rar' | 'file';
2
+ export type UploadRule = {
3
+ name: string;
4
+ type: UploadFileType;
5
+ color: string;
6
+ exts: string[];
7
+ };
8
+ export type UploadItem = {
9
+ uid: string;
10
+ name: string;
11
+ url: string;
12
+ preload?: string;
13
+ type: UploadFileType;
14
+ size?: number;
15
+ progress: number;
16
+ error?: string;
17
+ };
18
+ export type UploadOptions = {
19
+ prefixPath?: string;
20
+ onProgress?: (progress: number) => void;
21
+ };
22
+ export type UploadResult = {
23
+ url: string;
24
+ key?: string;
25
+ fileId?: string;
26
+ };
@@ -0,0 +1,10 @@
1
+ export type BrowserScreen = 'xs' | 'sm' | 'md' | 'xl' | 'full';
2
+ export type BrowserInfo = {
3
+ height: number;
4
+ width: number;
5
+ type: string;
6
+ /** 断点:xs <768 / sm <992 / md <1200 / xl <1920 / full */
7
+ screen: BrowserScreen;
8
+ /** 迷你布局:侧栏收起或移动端 */
9
+ isMini: boolean;
10
+ };
@@ -0,0 +1,13 @@
1
+ import type { Component } from 'vue';
2
+ /** 视图异步加载器 */
3
+ export type ViewLoader = () => Promise<{
4
+ default: Component;
5
+ }>;
6
+ /** 视图路径树(菜单 viewPath 选择) */
7
+ export type ViewsTreeNode = {
8
+ label: string;
9
+ /** 完整 viewPath(叶子)或路径前缀(目录) */
10
+ value: string;
11
+ isLeaf?: boolean;
12
+ children?: ViewsTreeNode[];
13
+ };