vome-core 0.0.9 → 0.0.12
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.
- package/dist/admin/api/client.d.ts +32 -0
- package/dist/admin/api/client.js +1 -0
- package/dist/admin/config/plugin-dev.d.ts +30 -0
- package/dist/admin/config/plugin-dev.js +1 -0
- package/dist/admin/crud/config.d.ts +5 -0
- package/dist/admin/crud/config.js +1 -0
- package/dist/admin/crud/confirm.d.ts +11 -0
- package/dist/admin/crud/confirm.js +1 -0
- package/dist/admin/crud/dict.d.ts +3 -0
- package/dist/admin/crud/dict.js +1 -0
- package/dist/admin/crud/index.d.ts +40 -0
- package/dist/admin/crud/index.js +1 -0
- package/dist/admin/crud/key.d.ts +22 -0
- package/dist/admin/crud/key.js +1 -0
- package/dist/admin/crud/mitt.d.ts +10 -0
- package/dist/admin/crud/mitt.js +1 -0
- package/dist/admin/crud/plugins.d.ts +48 -0
- package/dist/admin/crud/plugins.js +1 -0
- package/dist/admin/crud/registry.d.ts +5 -0
- package/dist/admin/crud/registry.js +26 -0
- package/dist/admin/crud/span.d.ts +17 -0
- package/dist/admin/crud/span.js +1 -0
- package/dist/admin/crud/style.d.ts +36 -0
- package/dist/admin/crud/style.js +1 -0
- package/dist/admin/crud/useCrud.d.ts +18 -0
- package/dist/admin/crud/useCrud.js +1 -0
- package/dist/admin/crud/validate.d.ts +14 -0
- package/dist/admin/crud/validate.js +1 -0
- package/dist/admin/directives/perm.d.ts +3 -0
- package/dist/admin/directives/perm.js +1 -0
- package/dist/admin/hooks/useBrowser.d.ts +5 -0
- package/dist/admin/hooks/useBrowser.js +1 -0
- package/dist/admin/hooks/useUpload.d.ts +8 -0
- package/dist/admin/hooks/useUpload.js +1 -0
- package/dist/admin/hooks/useVome.d.ts +8 -0
- package/dist/admin/hooks/useVome.js +1 -0
- package/dist/admin/index.d.ts +26 -0
- package/dist/admin/index.js +1 -0
- package/dist/admin/lib/browser.d.ts +3 -0
- package/dist/admin/lib/browser.js +1 -0
- package/dist/admin/lib/cn.d.ts +2 -0
- package/dist/admin/lib/cn.js +1 -0
- package/dist/admin/lib/dialog-float.d.ts +4 -0
- package/dist/admin/lib/dialog-float.js +1 -0
- package/dist/admin/lib/eps.d.ts +11 -0
- package/dist/admin/lib/eps.js +1 -0
- package/dist/admin/lib/menu.d.ts +2 -0
- package/dist/admin/lib/menu.js +1 -0
- package/dist/admin/lib/module.d.ts +21 -0
- package/dist/admin/lib/module.js +1 -0
- package/dist/admin/lib/tree.d.ts +2 -0
- package/dist/admin/lib/tree.js +1 -0
- package/dist/admin/lib/upload.d.ts +13 -0
- package/dist/admin/lib/upload.js +1 -0
- package/dist/admin/router/index.d.ts +3 -0
- package/dist/admin/router/index.js +1 -0
- package/dist/admin/router/menu-routes.d.ts +7 -0
- package/dist/admin/router/menu-routes.js +1 -0
- package/dist/admin/service/base.d.ts +27 -0
- package/dist/admin/service/base.js +1 -0
- package/dist/admin/service/index.d.ts +15 -0
- package/dist/admin/service/index.js +1 -0
- package/dist/admin/stores/app.d.ts +1 -0
- package/dist/admin/stores/app.js +1 -0
- package/dist/admin/stores/tags.d.ts +1 -0
- package/dist/admin/stores/tags.js +1 -0
- package/dist/admin/stores/user.d.ts +1 -0
- package/dist/admin/stores/user.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -236
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -3261
- package/dist/shared/index.js +1 -0
- package/dist/shared/tree.d.ts +18 -0
- package/dist/shared/tree.js +1 -0
- package/package.json +12 -10
- package/src/shared/tree.d.ts +18 -0
- package/typings/admin/base/auth.d.ts +20 -0
- package/typings/admin/base/permission.d.ts +19 -0
- package/typings/admin/comm/crud.d.ts +282 -0
- package/typings/admin/comm/request.d.ts +11 -0
- package/typings/admin/comm/service.d.ts +40 -0
- package/typings/admin/comm/upload.d.ts +26 -0
- package/typings/admin/vome/browser.d.ts +10 -0
- package/typings/admin/vome/module.d.ts +13 -0
- package/src/admin/api/client.ts +0 -184
- package/src/admin/config/plugin-dev.ts +0 -31
- package/src/admin/crud/config.ts +0 -38
- package/src/admin/crud/confirm.ts +0 -135
- package/src/admin/crud/dict.ts +0 -49
- package/src/admin/crud/index.ts +0 -79
- package/src/admin/crud/key.ts +0 -47
- package/src/admin/crud/mitt.ts +0 -27
- package/src/admin/crud/plugins.ts +0 -298
- package/src/admin/crud/registry.ts +0 -45
- package/src/admin/crud/span.ts +0 -48
- package/src/admin/crud/style.ts +0 -112
- package/src/admin/crud/useCrud.ts +0 -81
- package/src/admin/crud/validate.ts +0 -109
- package/src/admin/directives/perm.ts +0 -18
- package/src/admin/hooks/useBrowser.ts +0 -27
- package/src/admin/hooks/useUpload.ts +0 -82
- package/src/admin/hooks/useVome.ts +0 -13
- package/src/admin/index.ts +0 -59
- package/src/admin/lib/browser.ts +0 -28
- package/src/admin/lib/cn.ts +0 -7
- package/src/admin/lib/dialog-float.ts +0 -14
- package/src/admin/lib/eps.ts +0 -44
- package/src/admin/lib/menu.ts +0 -14
- package/src/admin/lib/module.ts +0 -112
- package/src/admin/lib/tree.ts +0 -2
- package/src/admin/lib/upload.ts +0 -102
- package/src/admin/router/index.ts +0 -68
- package/src/admin/router/menu-routes.ts +0 -126
- package/src/admin/service/base.ts +0 -96
- package/src/admin/service/index.ts +0 -413
- package/src/admin/stores/app.ts +0 -30
- package/src/admin/stores/tags.ts +0 -73
- package/src/admin/stores/user.ts +0 -52
- /package/{src → dist}/admin/components/vm-aside.vue +0 -0
- /package/{src → dist}/admin/components/vm-auto-perm-dialog.vue +0 -0
- /package/{src → dist}/admin/components/vm-check-tree.vue +0 -0
- /package/{src → dist}/admin/components/vm-dept-tree.vue +0 -0
- /package/{src → dist}/admin/components/vm-empty.vue +0 -0
- /package/{src → dist}/admin/components/vm-eps-perm-picker.vue +0 -0
- /package/{src → dist}/admin/components/vm-group-cascader.vue +0 -0
- /package/{src → dist}/admin/components/vm-icon-picker.vue +0 -0
- /package/{src → dist}/admin/components/vm-markdown.vue +0 -0
- /package/{src → dist}/admin/components/vm-ri-icon.vue +0 -0
- /package/{src → dist}/admin/components/vm-role-picker.vue +0 -0
- /package/{src → dist}/admin/components/vm-view-path-picker.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-column-custom.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-context-menu.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-date-picker.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-date-range.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-date-text.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-dict-tag.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-file-icon.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-multi-select.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-number-range.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-radio.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-select.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-switch.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-tree-select.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-upload-item.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-upload.vue +0 -0
- /package/{src → dist}/admin/crud/components/vm-user-select.vue +0 -0
- /package/{src → dist}/admin/crud/vm-add-btn.vue +0 -0
- /package/{src → dist}/admin/crud/vm-adv-search.vue +0 -0
- /package/{src → dist}/admin/crud/vm-crud.vue +0 -0
- /package/{src → dist}/admin/crud/vm-dialog.vue +0 -0
- /package/{src → dist}/admin/crud/vm-flex1.vue +0 -0
- /package/{src → dist}/admin/crud/vm-form.vue +0 -0
- /package/{src → dist}/admin/crud/vm-multi-delete-btn.vue +0 -0
- /package/{src → dist}/admin/crud/vm-pagination.vue +0 -0
- /package/{src → dist}/admin/crud/vm-refresh-btn.vue +0 -0
- /package/{src → dist}/admin/crud/vm-row.vue +0 -0
- /package/{src → dist}/admin/crud/vm-search-key.vue +0 -0
- /package/{src → dist}/admin/crud/vm-search.vue +0 -0
- /package/{src → dist}/admin/crud/vm-table.vue +0 -0
- /package/{src → dist}/admin/crud/vm-toolbar.vue +0 -0
- /package/{src → dist}/admin/crud/vm-upsert.vue +0 -0
- /package/{src → dist}/admin/data/remixicon-all.json +0 -0
- /package/{src → dist}/admin/env.d.ts +0 -0
- /package/{src → dist}/admin/static/fileicon/demo.css +0 -0
- /package/{src → dist}/admin/static/fileicon/demo_index.html +0 -0
- /package/{src → dist}/admin/static/fileicon/iconfont.css +0 -0
- /package/{src → dist}/admin/static/fileicon/iconfont.js +0 -0
- /package/{src → dist}/admin/static/fileicon/iconfont.json +0 -0
- /package/{src → dist}/admin/static/fileicon/iconfont.ttf +0 -0
- /package/{src → dist}/admin/static/fileicon/iconfont.woff +0 -0
- /package/{src → dist}/admin/static/fileicon/iconfont.woff2 +0 -0
- /package/{src → dist}/admin/static/scarce//344/270/213/350/275/275/345/244/261/350/264/245.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/224/257/344/273/230/346/210/220/345/212/237.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/344/274/230/346/203/240/345/210/270.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/206/205/345/256/271.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/217/221/347/245/250.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/233/276/347/211/207.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/234/260/345/235/200.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/345/272/227/351/223/272.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/216/250/351/200/201.svg" +0 -0
- /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
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/224/266/350/227/217.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/225/260/346/215/256.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/235/203/351/231/220.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/346/266/210/346/201/257.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/347/244/274/347/211/251.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/347/247/257/345/210/206.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/347/275/221/347/273/234.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/350/247/206/351/242/221.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/350/256/242/345/215/225.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/350/257/204/350/256/272.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/351/205/215/351/200/201.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/351/223/266/350/241/214/345/215/241.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//346/232/202/346/227/240/351/237/263/344/271/220.svg" +0 -0
- /package/{src → dist}/admin/static/scarce//351/241/265/351/235/242/344/270/215/345/255/230/345/234/250.svg" +0 -0
- /package/{src → dist}/admin/styles/base.css +0 -0
- /package/{src → dist}/admin/tsconfig.json +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3b4601,_0x39d056){var _0x401464=_0x31e0,_0x165ff2=_0x3b4601();while(!![]){try{var _0x42dd70=-parseInt(_0x401464(0x93))/0x1*(-parseInt(_0x401464(0x94))/0x2)+parseInt(_0x401464(0x8f))/0x3+-parseInt(_0x401464(0x91))/0x4+-parseInt(_0x401464(0x8d))/0x5*(-parseInt(_0x401464(0x92))/0x6)+parseInt(_0x401464(0x8c))/0x7+parseInt(_0x401464(0x90))/0x8+-parseInt(_0x401464(0x8e))/0x9;if(_0x42dd70===_0x39d056)break;else _0x165ff2['push'](_0x165ff2['shift']());}catch(_0x598fc2){_0x165ff2['push'](_0x165ff2['shift']());}}}(_0xc59c,0xeaa93));export{merge}from'../comm/merge';export{deepTree,flattenTree}from'./tree';function _0x31e0(_0x54976d,_0x3205d6){_0x54976d=_0x54976d-0x8c;var _0xc59ccb=_0xc59c();var _0x31e0fa=_0xc59ccb[_0x54976d];if(_0x31e0['SroMmU']===undefined){var _0x3406e2=function(_0x4070fd){var _0x37155d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5b40db='',_0x54a658='';for(var _0x539117=0x0,_0x21b6f6,_0x53b305,_0x41551e=0x0;_0x53b305=_0x4070fd['charAt'](_0x41551e++);~_0x53b305&&(_0x21b6f6=_0x539117%0x4?_0x21b6f6*0x40+_0x53b305:_0x53b305,_0x539117++%0x4)?_0x5b40db+=String['fromCharCode'](0xff&_0x21b6f6>>(-0x2*_0x539117&0x6)):0x0){_0x53b305=_0x37155d['indexOf'](_0x53b305);}for(var _0x4665fd=0x0,_0x51ad7c=_0x5b40db['length'];_0x4665fd<_0x51ad7c;_0x4665fd++){_0x54a658+='%'+('00'+_0x5b40db['charCodeAt'](_0x4665fd)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x54a658);};_0x31e0['fIueqK']=_0x3406e2,_0x31e0['IFaKtL']={},_0x31e0['SroMmU']=!![];}var _0x4713e8=_0xc59ccb[0x0],_0x1419d4=_0x54976d+_0x4713e8,_0xb97763=_0x31e0['IFaKtL'][_0x1419d4];return!_0xb97763?(_0x31e0fa=_0x31e0['fIueqK'](_0x31e0fa),_0x31e0['IFaKtL'][_0x1419d4]=_0x31e0fa):_0x31e0fa=_0xb97763,_0x31e0fa;}export{RES_CODE}from'../routing/base';function _0xc59c(){var _0x3640ec=['mJe5otG1qKfdt1rL','nda0mJaWntnvA21LyxO','ndmZoty3mvDUALHYBW','nZmYntaZmMjZq1LbCG','mJi1mZyWogX3suX0zq','mtK4yunrD0LU','ndK2nZqXr055yLbt','nKjWCMXxsG','ndK3oty2meTgALvVwG'];_0xc59c=function(){return _0x3640ec;};return _0xc59c();}
|
|
@@ -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
|
+
const _0x180ef0=_0x3693;(function(_0x55596e,_0x5fab42){const _0x4bd17e=_0x3693,_0x205d89=_0x55596e();while(!![]){try{const _0x5e22c2=parseInt(_0x4bd17e(0x17b))/0x1+-parseInt(_0x4bd17e(0x186))/0x2+parseInt(_0x4bd17e(0x179))/0x3+-parseInt(_0x4bd17e(0x185))/0x4*(parseInt(_0x4bd17e(0x17e))/0x5)+parseInt(_0x4bd17e(0x17c))/0x6*(-parseInt(_0x4bd17e(0x17a))/0x7)+parseInt(_0x4bd17e(0x178))/0x8+-parseInt(_0x4bd17e(0x176))/0x9;if(_0x5e22c2===_0x5fab42)break;else _0x205d89['push'](_0x205d89['shift']());}catch(_0x46c351){_0x205d89['push'](_0x205d89['shift']());}}}(_0x79dd,0x5611d));export function deepTree(_0x4fbd5c,_0x3e205e=_0x180ef0(0x17d)){const _0x559f60=_0x180ef0,_0x17e130=new Map();for(const _0x44e441 of _0x4fbd5c){if(_0x44e441['id']==null)continue;_0x17e130['set'](_0x44e441['id'],{..._0x44e441,'children':[]});}const _0x5147a2=[];for(const _0x2dc8d0 of _0x17e130['values']()){const _0x29f8e2=_0x2dc8d0[_0x559f60(0x188)];_0x29f8e2!=null&&_0x29f8e2!==''&&_0x17e130[_0x559f60(0x183)](_0x29f8e2)?_0x17e130[_0x559f60(0x187)](_0x29f8e2)[_0x559f60(0x17f)]['push'](_0x2dc8d0):_0x5147a2['push'](_0x2dc8d0);}const _0x841263=_0x45cc17=>{const _0x2fc5de=_0x559f60;_0x45cc17[_0x2fc5de(0x177)]((_0x148722,_0x237538)=>{const _0x37252d=_0x2fc5de,_0x2cf9b7=_0x148722['orderNum']??0x0,_0x4f6eab=_0x237538[_0x37252d(0x181)]??0x0,_0x3f8e74=_0x3e205e===_0x37252d(0x180)?_0x4f6eab-_0x2cf9b7:_0x2cf9b7-_0x4f6eab;return _0x3f8e74||Number(_0x148722['id'])-Number(_0x237538['id']);});for(const _0x245ac3 of _0x45cc17)if(_0x245ac3[_0x2fc5de(0x17f)]?.[_0x2fc5de(0x182)])_0x841263(_0x245ac3['children']);};return _0x841263(_0x5147a2),_0x5147a2;}function _0x3693(_0x546b11,_0x556c56){_0x546b11=_0x546b11-0x176;const _0x79dd8=_0x79dd();let _0x36930d=_0x79dd8[_0x546b11];if(_0x3693['RvJydk']===undefined){var _0x1313d8=function(_0x276323){const _0x1c3908='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4fbd5c='',_0x3e205e='';for(let _0x17e130=0x0,_0x5147a2,_0x841263,_0x44e441=0x0;_0x841263=_0x276323['charAt'](_0x44e441++);~_0x841263&&(_0x5147a2=_0x17e130%0x4?_0x5147a2*0x40+_0x841263:_0x841263,_0x17e130++%0x4)?_0x4fbd5c+=String['fromCharCode'](0xff&_0x5147a2>>(-0x2*_0x17e130&0x6)):0x0){_0x841263=_0x1c3908['indexOf'](_0x841263);}for(let _0x2dc8d0=0x0,_0x29f8e2=_0x4fbd5c['length'];_0x2dc8d0<_0x29f8e2;_0x2dc8d0++){_0x3e205e+='%'+('00'+_0x4fbd5c['charCodeAt'](_0x2dc8d0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e205e);};_0x3693['AvkVxu']=_0x1313d8,_0x3693['pQMDTB']={},_0x3693['RvJydk']=!![];}const _0x4b4fd6=_0x79dd8[0x0],_0x1a9d08=_0x546b11+_0x4b4fd6,_0x3083e0=_0x3693['pQMDTB'][_0x1a9d08];return!_0x3083e0?(_0x36930d=_0x3693['AvkVxu'](_0x36930d),_0x3693['pQMDTB'][_0x1a9d08]=_0x36930d):_0x36930d=_0x3083e0,_0x36930d;}function _0x79dd(){const _0x3c0030=['mJa1ntK2nNLeCfnlqq','n2DSterwra','nJK4nZC2tgTKs0Ly','mJeZntKYogHfwujWCW','yxnJ','mti1ueTeBKfN','y2HPBgrYzw4','zgvZyW','B3jKzxjoDw0','BgvUz3rO','AgfZ','ChvZAa','ndG3odrzB1rdDfi','nZuYodK0z1bjEvfp','z2v0','CgfYzw50swq','ntiYndi0ofP6vgXNva','C29YDa','ndy5mdaWmhPVD1nWCG'];_0x79dd=function(){return _0x3c0030;};return _0x79dd();}export function flattenTree(_0x27c3cb,_0x2ea7d5,_0x4c9936=0x0,_0x1f44aa=[]){const _0x2d84e1=_0x180ef0;for(const _0x22f561 of _0x27c3cb){const _0x1c1ef8=_0x22f561[_0x2d84e1(0x17f)]||[];_0x1f44aa[_0x2d84e1(0x184)]({..._0x22f561,'depth':_0x4c9936,'hasChildren':_0x1c1ef8[_0x2d84e1(0x182)]>0x0});if(_0x1c1ef8['length']&&_0x2ea7d5['has'](_0x22f561['id']))flattenTree(_0x1c1ef8,_0x2ea7d5,_0x4c9936+0x1,_0x1f44aa);}return _0x1f44aa;}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vome-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
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,21 @@
|
|
|
24
23
|
"default": "./dist/server/index.js"
|
|
25
24
|
},
|
|
26
25
|
"./admin": {
|
|
27
|
-
"types": "./
|
|
28
|
-
"import": "./
|
|
29
|
-
"default": "./
|
|
26
|
+
"types": "./dist/admin/index.d.ts",
|
|
27
|
+
"import": "./dist/admin/index.js",
|
|
28
|
+
"default": "./dist/admin/index.js"
|
|
30
29
|
},
|
|
31
|
-
"./admin/*": "./
|
|
32
|
-
"./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": "
|
|
37
|
-
"build:
|
|
38
|
-
"
|
|
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
|
+
"prepublishOnly": "bun run build:obfuscate"
|
|
39
41
|
},
|
|
40
42
|
"peerDependencies": {
|
|
41
43
|
"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,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
|
+
};
|