vome-core 0.3.10 → 0.3.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.js +9 -8
- package/dist/admin/components/ui/avatar/index.js +1 -1
- package/dist/admin/components/ui/badge/index.d.ts +1 -1
- package/dist/admin/components/ui/button/index.d.ts +1 -1
- package/dist/admin/components/ui/checkbox/index.js +1 -1
- package/dist/admin/components/ui/dialog/index.js +1 -1
- package/dist/admin/components/ui/dropdown-menu/index.js +1 -1
- package/dist/admin/components/ui/input/Input.vue +2 -1
- package/dist/admin/components/ui/input/index.js +1 -1
- package/dist/admin/components/ui/label/index.js +1 -1
- package/dist/admin/components/ui/scroll-area/index.js +1 -1
- package/dist/admin/components/ui/select/index.js +1 -1
- package/dist/admin/components/ui/separator/index.js +1 -1
- package/dist/admin/components/ui/sheet/index.js +1 -1
- package/dist/admin/components/ui/sonner/index.js +1 -1
- package/dist/admin/components/ui/table/index.js +1 -1
- package/dist/admin/components/ui/tabs/index.js +1 -1
- package/dist/admin/components/ui/tooltip/index.js +1 -1
- package/dist/admin/components/vm-aside.vue +8 -6
- package/dist/admin/components/vm-auto-perm-dialog.vue +12 -11
- package/dist/admin/components/vm-check-tree.vue +3 -2
- package/dist/admin/components/vm-dept-tree.vue +31 -29
- package/dist/admin/components/vm-empty.vue +16 -2
- package/dist/admin/components/vm-eps-perm-picker.vue +3 -2
- package/dist/admin/components/vm-form-dialog.vue +4 -3
- package/dist/admin/components/vm-group-cascader.vue +5 -4
- package/dist/admin/components/vm-icon-picker.vue +24 -15
- package/dist/admin/components/vm-inline-search.vue +3 -2
- package/dist/admin/components/vm-loading.vue +4 -3
- package/dist/admin/components/vm-markdown.vue +6 -5
- package/dist/admin/components/vm-role-picker.vue +6 -5
- package/dist/admin/components/vm-view-path-picker.vue +3 -2
- package/dist/admin/crud/auto-fields.js +1 -1
- package/dist/admin/crud/components/vm-avatar.vue +2 -1
- package/dist/admin/crud/components/vm-color-picker.vue +8 -8
- package/dist/admin/crud/components/vm-column-custom.vue +6 -5
- package/dist/admin/crud/components/vm-copy-btn.vue +4 -3
- package/dist/admin/crud/components/vm-date-calendar-panel.vue +30 -27
- package/dist/admin/crud/components/vm-date-picker.vue +6 -5
- package/dist/admin/crud/components/vm-date-range.vue +5 -4
- package/dist/admin/crud/components/vm-datetime-field.vue +4 -3
- package/dist/admin/crud/components/vm-json-code.vue +3 -2
- package/dist/admin/crud/components/vm-json-editor.vue +3 -2
- package/dist/admin/crud/components/vm-json-kv-editor.vue +13 -12
- package/dist/admin/crud/components/vm-multi-select.vue +5 -4
- package/dist/admin/crud/components/vm-number-range.vue +5 -4
- package/dist/admin/crud/components/vm-preview-viewer.vue +33 -29
- package/dist/admin/crud/components/vm-richtext-extensions.js +1 -1
- package/dist/admin/crud/components/vm-richtext.vue +33 -30
- package/dist/admin/crud/components/vm-select.vue +4 -3
- package/dist/admin/crud/components/vm-status-tag.vue +2 -1
- package/dist/admin/crud/components/vm-switch.vue +5 -4
- package/dist/admin/crud/components/vm-text-link.vue +3 -2
- package/dist/admin/crud/components/vm-tree-select.vue +3 -2
- package/dist/admin/crud/components/vm-upload-item.vue +6 -4
- package/dist/admin/crud/components/vm-upload.vue +6 -5
- package/dist/admin/crud/config.js +1 -1
- package/dist/admin/crud/confirm.js +1 -1
- package/dist/admin/crud/crud-page-request.js +1 -1
- package/dist/admin/crud/data-i18n.js +1 -1
- package/dist/admin/crud/dict.d.ts +1 -1
- package/dist/admin/crud/dict.js +1 -1
- package/dist/admin/crud/export-fetch.js +1 -1
- package/dist/admin/crud/key.js +1 -1
- package/dist/admin/crud/plugins.js +1 -1
- package/dist/admin/crud/span.js +1 -1
- package/dist/admin/crud/style.js +1 -1
- package/dist/admin/crud/validate.js +1 -1
- package/dist/admin/crud/vm-crud.vue +15 -15
- package/dist/admin/crud/vm-data-i18n-btn.vue +1 -1
- package/dist/admin/crud/vm-export-btn.vue +7 -7
- package/dist/admin/crud/vm-import-btn.vue +33 -27
- package/dist/admin/crud/vm-table.vue +7 -2
- package/dist/admin/crud/vm-upsert.vue +1 -0
- package/dist/admin/directives/perm.js +1 -1
- package/dist/admin/hooks/useUpload.js +1 -1
- package/dist/admin/lib/browser.js +1 -1
- package/dist/admin/lib/cn.js +1 -1
- package/dist/admin/lib/dialog-float.js +1 -1
- package/dist/admin/lib/export-excel.js +1 -1
- package/dist/admin/lib/file-preview.js +8 -6
- package/dist/admin/lib/import-excel.js +1 -1
- package/dist/admin/lib/json.d.ts +0 -1
- package/dist/admin/lib/json.js +1 -1
- package/dist/admin/lib/menu.js +1 -1
- package/dist/admin/lib/micro-locale.js +1 -1
- package/dist/admin/lib/micro-theme.js +1 -1
- package/dist/admin/lib/shell.js +1 -1
- package/dist/admin/lib/theme-color-options.d.ts +1 -2
- package/dist/admin/lib/theme-color-options.js +1 -1
- package/dist/admin/lib/tree.js +1 -1
- package/dist/admin/lib/upload.d.ts +5 -0
- package/dist/admin/lib/upload.js +1 -1
- package/dist/admin/lib/video-frame.js +1 -1
- package/dist/admin/router/create.js +1 -1
- package/dist/admin/router/guards.js +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/client/ai-model-registry.js +1 -1
- package/dist/client/base.js +1 -1
- package/dist/client/configure.js +1 -1
- package/dist/client/dict.js +1 -1
- package/dist/client/eps-payload.js +1 -1
- package/dist/client/eps.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/locale-store.js +1 -1
- package/dist/client/service.js +1 -1
- package/dist/client/vite-admin.js +1 -1
- package/dist/client/vite-auto-import.js +1 -1
- package/dist/client/vite-micro-proxy.js +1 -1
- package/dist/client/vite-plugin-eps.js +1 -1
- package/dist/client/vite-resolve.js +1 -1
- package/dist/config/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/shared/datetime-picker.js +1 -1
- package/dist/shared/excel.js +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/locale-json.js +1 -1
- package/dist/shared/tree.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x356a55=_0x1dad;(function(_0x315862,_0x46d3a6){const _0x491bd6=_0x1dad,_0x31be11=_0x315862();while(!![]){try{const _0x11b011=-parseInt(_0x491bd6(0x1c0))/0x1*(parseInt(_0x491bd6(0x1b2))/0x2)+-parseInt(_0x491bd6(0x1aa))/0x3*(parseInt(_0x491bd6(0x1cc))/0x4)+-parseInt(_0x491bd6(0x1c7))/0x5*(parseInt(_0x491bd6(0x1be))/0x6)+parseInt(_0x491bd6(0x1ca))/0x7+-parseInt(_0x491bd6(0x1d4))/0x8*(parseInt(_0x491bd6(0x1d5))/0x9)+-parseInt(_0x491bd6(0x1a9))/0xa+parseInt(_0x491bd6(0x1b5))/0xb;if(_0x11b011===_0x46d3a6)break;else _0x31be11['push'](_0x31be11['shift']());}catch(_0xc00aa1){_0x31be11['push'](_0x31be11['shift']());}}}(_0x4db1,0xa1705));import{findEpsEntity}from'../lib/eps';import{getDictOptions}from'../../client';export const UPSERT_BUILTIN_IGNORE=['id',_0x356a55(0x1a2),_0x356a55(0x1da),_0x356a55(0x19c),_0x356a55(0x1d6)];export const TABLE_BUILTIN_IGNORE=[_0x356a55(0x1d6),_0x356a55(0x19c)];function dictKeyOf(_0x130948){const _0x283650=_0x356a55;if(typeof _0x130948[_0x283650(0x1a8)]===_0x283650(0x1c4)&&_0x130948['dict'])return _0x130948['dict'];if(Array['isArray'](_0x130948[_0x283650(0x1a8)])&&_0x130948[_0x283650(0x1a8)][0x0])return _0x130948[_0x283650(0x1a8)][0x0];return;}function isSwitchDict(_0x5ca5c1){const _0x3abc3f=_0x356a55;return _0x5ca5c1===_0x3abc3f(0x1b8)||_0x5ca5c1===_0x3abc3f(0x1cb);}function switchFormItem(_0x5475d7,_0x49b41e,_0x3a605f){const _0x1fb702=_0x356a55;return{..._0x5475d7,'type':_0x1fb702(0x1b1),'value':_0x3a605f,'dict':_0x49b41e,'component':{'props':()=>mapDictOptions(_0x49b41e)}};}function _0x1dad(_0x67c479,_0x3145a4){_0x67c479=_0x67c479-0x19c;const _0x4db1cd=_0x4db1();let _0x1dad49=_0x4db1cd[_0x67c479];if(_0x1dad['quHTWf']===undefined){var _0x40420f=function(_0x57befc){const _0xccf241='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x130948='',_0x5ca5c1='';for(let _0x5475d7=0x0,_0x49b41e,_0x3a605f,_0x3fc451=0x0;_0x3a605f=_0x57befc['charAt'](_0x3fc451++);~_0x3a605f&&(_0x49b41e=_0x5475d7%0x4?_0x49b41e*0x40+_0x3a605f:_0x3a605f,_0x5475d7++%0x4)?_0x130948+=String['fromCharCode'](0xff&_0x49b41e>>(-0x2*_0x5475d7&0x6)):0x0){_0x3a605f=_0xccf241['indexOf'](_0x3a605f);}for(let _0x365b93=0x0,_0x311f69=_0x130948['length'];_0x365b93<_0x311f69;_0x365b93++){_0x5ca5c1+='%'+('00'+_0x130948['charCodeAt'](_0x365b93)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5ca5c1);};_0x1dad['YezmwX']=_0x40420f,_0x1dad['ixiKYX']={},_0x1dad['quHTWf']=!![];}const _0x2c5c92=_0x4db1cd[0x0],_0x4f0173=_0x67c479+_0x2c5c92,_0x2b7b28=_0x1dad['ixiKYX'][_0x4f0173];return!_0x2b7b28?(_0x1dad49=_0x1dad['YezmwX'](_0x1dad49),_0x1dad['ixiKYX'][_0x4f0173]=_0x1dad49):_0x1dad49=_0x2b7b28,_0x1dad49;}export function mapDictOptions(_0x3fc451){const _0x1fdbe1=_0x356a55;return getDictOptions(_0x3fc451)[_0x1fdbe1(0x1d0)](_0x365b93=>{const _0x255dbb=_0x1fdbe1;let _0x311f69=_0x365b93[_0x255dbb(0x1c1)];return typeof _0x365b93[_0x255dbb(0x1c1)]===_0x255dbb(0x1c4)&&/^-?\d+(\.\d+)?$/[_0x255dbb(0x1b3)](_0x365b93['value'])&&(_0x311f69=Number(_0x365b93['value'])),{'label':String(_0x365b93['label']??''),'value':_0x311f69,'color':_0x365b93[_0x255dbb(0x1a4)]};});}function isMainTableCol(_0x46a558){const _0x545471=_0x356a55;return!_0x46a558['source']||_0x46a558[_0x545471(0x1c8)][_0x545471(0x1ba)]('a.');}function epsColumns(_0x4d5fbe){const _0x370a70=_0x356a55,_0x4c1cf0=_0x4d5fbe['namespace']?findEpsEntity('/'+_0x4d5fbe[_0x370a70(0x1c2)]):undefined;if(!_0x4c1cf0)return[];const _0x4633bd=[..._0x4c1cf0[_0x370a70(0x1a1)]||[],..._0x4c1cf0[_0x370a70(0x1c3)]||[]],_0x4c3d89=new Set(),_0x1486c9=[];for(const _0x1d3544 of _0x4633bd){if(!_0x1d3544['propertyName']||!isMainTableCol(_0x1d3544))continue;if(_0x4c3d89[_0x370a70(0x1d1)](_0x1d3544[_0x370a70(0x1bf)]))continue;_0x4c3d89['add'](_0x1d3544[_0x370a70(0x1bf)]),_0x1486c9[_0x370a70(0x1ac)](_0x1d3544);}return _0x1486c9;}function columnTypeOf(_0x529d50){return String(_0x529d50['columnType']||'');}function sqlTypeOf(_0x24b81f){const _0x2be231=_0x356a55;return String(_0x24b81f[_0x2be231(0x1cf)]||'')[_0x2be231(0x1d7)]();}function isTextCol(_0x3cd2e6){const _0x5858fd=_0x356a55,_0xcacde7=columnTypeOf(_0x3cd2e6);if(_0xcacde7===_0x5858fd(0x1a7))return!![];return sqlTypeOf(_0x3cd2e6)==='text';}function isIntegerCol(_0x5c16ca){const _0x53d211=_0x356a55,_0x530b94=columnTypeOf(_0x5c16ca);if(_0x530b94===_0x53d211(0x19d)||_0x530b94===_0x53d211(0x1d9)||_0x530b94===_0x53d211(0x1bd)||_0x530b94===_0x53d211(0x1bc)||_0x530b94==='PgSmallSerial'||_0x530b94===_0x53d211(0x1a3))return!![];if(_0x5c16ca['type']==='number'&&!isNumericCol(_0x5c16ca))return!![];return/^(integer|serial|smallint|bigint|smallserial|bigserial)\b/[_0x53d211(0x1b3)](sqlTypeOf(_0x5c16ca));}function isNumericCol(_0xd95d5){const _0x5d85bc=_0x356a55,_0x5f1ff4=columnTypeOf(_0xd95d5);if(_0x5f1ff4===_0x5d85bc(0x1b9)||_0x5f1ff4===_0x5d85bc(0x1cd)||_0x5f1ff4==='PgReal')return!![];return/^(numeric|decimal|double|real)\b/[_0x5d85bc(0x1b3)](sqlTypeOf(_0xd95d5));}function isBooleanCol(_0x1b0a88){const _0x9c90bb=_0x356a55;return columnTypeOf(_0x1b0a88)===_0x9c90bb(0x1ce)||_0x1b0a88[_0x9c90bb(0x19e)]===_0x9c90bb(0x1bb)||sqlTypeOf(_0x1b0a88)[_0x9c90bb(0x1ba)]('boolean');}function numberPrecision(_0x1fd6d8){const _0xa2f0c4=_0x356a55;if(isIntegerCol(_0x1fd6d8))return 0x0;if(typeof _0x1fd6d8[_0xa2f0c4(0x1ab)]===_0xa2f0c4(0x1d2))return _0x1fd6d8['scale'];return 0x2;}export function mergeByProp(_0x3150da,_0x520304){const _0x3c1982=_0x356a55,_0x1aac9d=_0x520304[_0x3c1982(0x1d8)](_0x57951d=>Boolean(_0x57951d['prop'])),_0x18f016=_0x520304[_0x3c1982(0x1d8)](_0x247210=>!_0x247210[_0x3c1982(0x1c5)]&&_0x247210[_0x3c1982(0x19e)]),_0x2ca38e=new Map(_0x1aac9d[_0x3c1982(0x1d0)](_0x1c777f=>[String(_0x1c777f['prop']),_0x1c777f])),_0x3d4a94=new Set(_0x18f016[_0x3c1982(0x1d0)](_0x4262d6=>String(_0x4262d6['type']))),_0x3f1517=new Set(),_0x4a535b=[];for(const _0x3e2a13 of _0x3150da){if(!_0x3e2a13[_0x3c1982(0x1c5)]&&_0x3e2a13['type']){if(_0x3d4a94[_0x3c1982(0x1d1)](String(_0x3e2a13['type'])))continue;_0x4a535b[_0x3c1982(0x1ac)](_0x3e2a13);continue;}if(!_0x3e2a13[_0x3c1982(0x1c5)])continue;const _0x2f0202=String(_0x3e2a13[_0x3c1982(0x1c5)]),_0x3e2849=_0x2ca38e[_0x3c1982(0x1b7)](_0x2f0202);_0x3e2849?(_0x4a535b[_0x3c1982(0x1ac)]({..._0x3e2a13,..._0x3e2849}),_0x3f1517[_0x3c1982(0x19f)](_0x2f0202)):_0x4a535b[_0x3c1982(0x1ac)](_0x3e2a13);}for(const _0x557657 of _0x1aac9d){const _0x10aa48=String(_0x557657[_0x3c1982(0x1c5)]);if(!_0x3f1517['has'](_0x10aa48))_0x4a535b[_0x3c1982(0x1ac)](_0x557657);}return _0x4a535b['push'](..._0x18f016),_0x4a535b;}export function sortRequiredFirst(_0x4defbf){const _0x525147=_0x356a55,_0x2d2013=[],_0x1d73f5=[];for(const _0x1ab161 of _0x4defbf){_0x1ab161[_0x525147(0x1b4)]===!![]||typeof _0x1ab161['required']===_0x525147(0x1a5)?_0x2d2013['push'](_0x1ab161):_0x1d73f5[_0x525147(0x1ac)](_0x1ab161);}return[..._0x2d2013,..._0x1d73f5];}export function buildAutoUpsertItems(_0x12a6ef,_0x22cc97={}){const _0x11671e=_0x356a55,_0x634f30=new Set([...UPSERT_BUILTIN_IGNORE,..._0x22cc97[_0x11671e(0x1ad)]||[]]),_0x56faf5=[];for(const _0x273db5 of epsColumns(_0x12a6ef)){const _0x48596f=_0x273db5[_0x11671e(0x1bf)];if(_0x634f30['has'](_0x48596f))continue;const _0x25d8d1=_0x273db5['comment']||_0x48596f,_0x477b71=dictKeyOf(_0x273db5),_0x38a9a0=_0x273db5[_0x11671e(0x1c9)]===![]&&_0x273db5[_0x11671e(0x1a6)]!==!![],_0x523529={'prop':_0x48596f,'label':_0x25d8d1,'span':0xc,..._0x38a9a0?{'required':!![]}:{}};if(_0x48596f==='status'){const _0x3adff8=_0x477b71||_0x11671e(0x1b8);isSwitchDict(_0x3adff8)?_0x56faf5['push'](switchFormItem(_0x523529,_0x3adff8,0x1)):_0x56faf5[_0x11671e(0x1ac)]({..._0x523529,'type':_0x11671e(0x1d3),'dict':_0x3adff8,'value':0x1});continue;}if(_0x477b71){isSwitchDict(_0x477b71)?_0x56faf5[_0x11671e(0x1ac)](switchFormItem(_0x523529,_0x477b71,_0x477b71===_0x11671e(0x1cb)?![]:0x1)):_0x56faf5[_0x11671e(0x1ac)]({..._0x523529,'type':_0x11671e(0x1d3),'dict':_0x477b71,'value':0x0});continue;}if(isTextCol(_0x273db5)){_0x56faf5['push']({..._0x523529,'type':_0x11671e(0x1b6),'span':0xc});continue;}if(isBooleanCol(_0x273db5)){_0x56faf5[_0x11671e(0x1ac)]({..._0x523529,'type':_0x11671e(0x1b1),'value':![],'component':{'props':()=>mapDictOptions(_0x11671e(0x1cb))},'dict':_0x11671e(0x1cb)});continue;}if(isIntegerCol(_0x273db5)||isNumericCol(_0x273db5)){const _0x4a616e=numberPrecision(_0x273db5);_0x56faf5[_0x11671e(0x1ac)]({..._0x523529,'type':_0x11671e(0x1d2),'component':{'props':{'type':_0x11671e(0x1d2),'precision':_0x4a616e,'controls':![]}}});continue;}_0x56faf5[_0x11671e(0x1ac)]({..._0x523529,'type':_0x11671e(0x1af)});}return _0x56faf5;}export function buildAutoTableColumns(_0x216f45,_0x5e3120={}){const _0x529db7=_0x356a55,_0x13978b=new Set([...TABLE_BUILTIN_IGNORE,..._0x5e3120[_0x529db7(0x1ad)]||[]]),_0x4102f1=[];!_0x13978b[_0x529db7(0x1d1)]('selection')&&_0x4102f1[_0x529db7(0x1ac)]({'type':_0x529db7(0x1ae),'width':0x32});for(const _0x28302d of epsColumns(_0x216f45)){const _0x39c29d=_0x28302d['propertyName'];if(_0x13978b[_0x529db7(0x1d1)](_0x39c29d))continue;const _0x3fe961=_0x28302d[_0x529db7(0x1c6)]||_0x39c29d,_0x255be1=dictKeyOf(_0x28302d);if(_0x39c29d==='status'){const _0x4d4f6e=_0x255be1||_0x529db7(0x1b8);isSwitchDict(_0x4d4f6e)?_0x4102f1[_0x529db7(0x1ac)]({'prop':_0x39c29d,'label':_0x3fe961,'width':0x50,'fixed':_0x529db7(0x1a0),'component':{'name':_0x529db7(0x1b0),'props':()=>mapDictOptions(_0x4d4f6e)}}):_0x4102f1[_0x529db7(0x1ac)]({'prop':_0x39c29d,'label':_0x3fe961,'width':0x64,'fixed':_0x529db7(0x1a0),'dict':()=>mapDictOptions(_0x4d4f6e)});continue;}if(_0x255be1&&isSwitchDict(_0x255be1)){_0x4102f1[_0x529db7(0x1ac)]({'prop':_0x39c29d,'label':_0x3fe961,'width':0x50,'component':{'name':_0x529db7(0x1b0),'props':()=>mapDictOptions(_0x255be1)}});continue;}if(_0x39c29d==='id'){_0x4102f1['push']({'prop':_0x39c29d,'label':_0x3fe961,'width':0x50});continue;}if(_0x39c29d==='createTime'){_0x4102f1[_0x529db7(0x1ac)]({'prop':_0x39c29d,'label':_0x3fe961,'width':0xa0});continue;}if(_0x255be1){_0x4102f1[_0x529db7(0x1ac)]({'prop':_0x39c29d,'label':_0x3fe961,'minWidth':0x78,'dict':()=>mapDictOptions(_0x255be1)});continue;}if(isTextCol(_0x28302d)){_0x4102f1[_0x529db7(0x1ac)]({'prop':_0x39c29d,'label':_0x3fe961,'minWidth':0xa0,'showOverflowTooltip':!![]});continue;}_0x4102f1[_0x529db7(0x1ac)]({'prop':_0x39c29d,'label':_0x3fe961,'minWidth':0x78});}return!_0x13978b[_0x529db7(0x1d1)]('op')&&_0x4102f1['push']({'type':'op','buttons':['edit','delete']}),_0x4102f1;}function _0x4db1(){const _0x194f0c=['mtK1wK94ue5c','C2nHBgu','ChvZAa','AwDUB3jLrMLLBgrZ','C2vSzwn0Aw9U','Aw5WDxq','DM0TC3DPDgnO','C3DPDgnO','ndzVr0nKENe','DgvZDa','CMvXDwLYzwq','mJq0nZK4mJL1tKTUqwy','Dgv4DgfYzwe','z2v0','C3rHDhvZ','ugDoDw1LCMLJ','C3rHCNrZv2L0Aa','yM9VBgvHBG','ugDcAwDjBNq','ugDtBwfSBeLUDa','mtj5AM5SDgm','ChjVCgvYDhLoyw1L','nJq5mw9zuvbmqG','DMfSDwu','BMfTzxnWywnL','CgfNzunVBhvTBNm','C3rYAw5N','ChjVCa','y29TBwvUDa','nZuWmdu1vvrXzLr1','C291CMnL','BNvSBgfIBgu','nJaXmty3merICKfzCq','EwvZx25V','ntqWotjyyvHZwK0','ugDeB3vIBgvqCMvJAxnPB24','ugDcB29SzwfU','C3fSvhLWzq','BwfW','AgfZ','BNvTyMvY','C2vSzwn0','mZuWne9VCgXYuq','mty4mdnNrgPdCgm','zgvSzxrLvgLTzq','Dg9mB3DLCKnHC2u','zMLSDgvY','ugDtzxjPywW','y3jLyxrLvgLTzq','DxbKyxrLvgLTzq','ugDjBNrLz2vY','DhLWzq','ywrK','CMLNAhq','y29SDw1UCW','DgvUyw50swq','ugDcAwDtzxjPywW','y29SB3i','zNvUy3rPB24','AgfZrgvMyxvSDa','ugDuzxH0','zgLJDa','mJC2otqWmejhC052uq'];_0x4db1=function(){return _0x194f0c;};return _0x4db1();}
|
|
1
|
+
const _0x1acde2=_0x3c79;(function(_0x58fb29,_0x360cdc){const _0x8251ec=_0x3c79,_0x3e0f9c=_0x58fb29();while(!![]){try{const _0x3fc54f=-parseInt(_0x8251ec(0x1f8))/0x1*(-parseInt(_0x8251ec(0x1d2))/0x2)+-parseInt(_0x8251ec(0x1d0))/0x3+parseInt(_0x8251ec(0x1f6))/0x4*(parseInt(_0x8251ec(0x1c6))/0x5)+-parseInt(_0x8251ec(0x1cd))/0x6*(-parseInt(_0x8251ec(0x1c7))/0x7)+parseInt(_0x8251ec(0x1cf))/0x8*(-parseInt(_0x8251ec(0x1df))/0x9)+parseInt(_0x8251ec(0x1ec))/0xa+-parseInt(_0x8251ec(0x1f1))/0xb*(parseInt(_0x8251ec(0x1d6))/0xc);if(_0x3fc54f===_0x360cdc)break;else _0x3e0f9c['push'](_0x3e0f9c['shift']());}catch(_0x3d6eb0){_0x3e0f9c['push'](_0x3e0f9c['shift']());}}}(_0x4f05,0xb0d15));import{findEpsEntity}from'../lib/eps';import{getDictOptions}from'../../client';export const UPSERT_BUILTIN_IGNORE=['id','tenantId',_0x1acde2(0x1ea),'updateTime',_0x1acde2(0x1de)];export const TABLE_BUILTIN_IGNORE=['deleteTime','updateTime'];function dictKeyOf(_0x5064d3){const _0x11dbff=_0x1acde2;if(typeof _0x5064d3['dict']==='string'&&_0x5064d3[_0x11dbff(0x1fa)])return _0x5064d3['dict'];if(Array['isArray'](_0x5064d3[_0x11dbff(0x1fa)])&&_0x5064d3[_0x11dbff(0x1fa)][0x0])return _0x5064d3['dict'][0x0];return;}function isSwitchDict(_0x539a28){const _0x5006c6=_0x1acde2;return _0x539a28==='status'||_0x539a28==='yes_no_boolean'||_0x539a28===_0x5006c6(0x1f5);}function switchDefaultValue(_0x3a4c5a){const _0x50088a=_0x1acde2;if(_0x3a4c5a===_0x50088a(0x1d3))return![];if(_0x3a4c5a===_0x50088a(0x1f5))return 0x0;return 0x1;}function switchFormItem(_0x13edfc,_0x6f8449,_0x26fa3a){const _0x1ed09e=_0x1acde2;return{..._0x13edfc,'type':_0x1ed09e(0x1e3),'value':_0x26fa3a,'dict':_0x6f8449,'component':{'props':()=>mapDictOptions(_0x6f8449)}};}export function mapDictOptions(_0xe313d7){const _0x4fd3ca=_0x1acde2;return getDictOptions(_0xe313d7)[_0x4fd3ca(0x1d1)](_0x20d948=>{const _0x2cdf17=_0x4fd3ca;let _0x2333df=_0x20d948['value'];return typeof _0x20d948[_0x2cdf17(0x1e0)]==='string'&&/^-?\d+(\.\d+)?$/[_0x2cdf17(0x1d7)](_0x20d948['value'])&&(_0x2333df=Number(_0x20d948[_0x2cdf17(0x1e0)])),{'label':String(_0x20d948[_0x2cdf17(0x1ca)]??''),'value':_0x2333df,'color':_0x20d948['color']};});}function isMainTableCol(_0x511ddb){const _0x351c8a=_0x1acde2;return!_0x511ddb[_0x351c8a(0x1ee)]||_0x511ddb[_0x351c8a(0x1ee)][_0x351c8a(0x1cc)]('a.');}function _0x3c79(_0x3281be,_0x2f7c19){_0x3281be=_0x3281be-0x1c4;const _0x4f0529=_0x4f05();let _0x3c7941=_0x4f0529[_0x3281be];if(_0x3c79['llmAhQ']===undefined){var _0x326fb2=function(_0x52e0b5){const _0x5bb739='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5064d3='',_0x539a28='';for(let _0x3a4c5a=0x0,_0x13edfc,_0x6f8449,_0x26fa3a=0x0;_0x6f8449=_0x52e0b5['charAt'](_0x26fa3a++);~_0x6f8449&&(_0x13edfc=_0x3a4c5a%0x4?_0x13edfc*0x40+_0x6f8449:_0x6f8449,_0x3a4c5a++%0x4)?_0x5064d3+=String['fromCharCode'](0xff&_0x13edfc>>(-0x2*_0x3a4c5a&0x6)):0x0){_0x6f8449=_0x5bb739['indexOf'](_0x6f8449);}for(let _0xe313d7=0x0,_0x20d948=_0x5064d3['length'];_0xe313d7<_0x20d948;_0xe313d7++){_0x539a28+='%'+('00'+_0x5064d3['charCodeAt'](_0xe313d7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x539a28);};_0x3c79['CLMwHB']=_0x326fb2,_0x3c79['ECmcJM']={},_0x3c79['llmAhQ']=!![];}const _0x3dce31=_0x4f0529[0x0],_0x252688=_0x3281be+_0x3dce31,_0x3b48d6=_0x3c79['ECmcJM'][_0x252688];return!_0x3b48d6?(_0x3c7941=_0x3c79['CLMwHB'](_0x3c7941),_0x3c79['ECmcJM'][_0x252688]=_0x3c7941):_0x3c7941=_0x3b48d6,_0x3c7941;}function epsColumns(_0x551a04){const _0x2c8c92=_0x1acde2,_0x18033d=_0x551a04[_0x2c8c92(0x1db)]?findEpsEntity('/'+_0x551a04[_0x2c8c92(0x1db)]):undefined;if(!_0x18033d)return[];const _0x5f3c9f=[..._0x18033d[_0x2c8c92(0x1dd)]||[],..._0x18033d['pageColumns']||[]],_0x45caad=new Set(),_0x111f80=[];for(const _0x2884d9 of _0x5f3c9f){if(!_0x2884d9[_0x2c8c92(0x200)]||!isMainTableCol(_0x2884d9))continue;if(_0x45caad[_0x2c8c92(0x1e7)](_0x2884d9[_0x2c8c92(0x200)]))continue;_0x45caad['add'](_0x2884d9[_0x2c8c92(0x200)]),_0x111f80[_0x2c8c92(0x1f2)](_0x2884d9);}return _0x111f80;}function columnTypeOf(_0x28a693){const _0x5b5ab4=_0x1acde2;return String(_0x28a693[_0x5b5ab4(0x1e2)]||'');}function sqlTypeOf(_0x513aa8){const _0x403077=_0x1acde2;return String(_0x513aa8[_0x403077(0x1ed)]||'')[_0x403077(0x1eb)]();}function isTextCol(_0x57a2b4){const _0x4a4644=_0x1acde2,_0x772f90=columnTypeOf(_0x57a2b4);if(_0x772f90===_0x4a4644(0x1c9))return!![];return sqlTypeOf(_0x57a2b4)===_0x4a4644(0x1d5);}function isIntegerCol(_0x5cbeda){const _0x3b7509=_0x1acde2,_0x22839a=columnTypeOf(_0x5cbeda);if(_0x22839a===_0x3b7509(0x1fe)||_0x22839a===_0x3b7509(0x1d4)||_0x22839a==='PgSmallInt'||_0x22839a===_0x3b7509(0x1c4)||_0x22839a===_0x3b7509(0x1e6)||_0x22839a==='PgBigSerial')return!![];if(_0x5cbeda[_0x3b7509(0x1d9)]===_0x3b7509(0x1e1)&&!isNumericCol(_0x5cbeda))return!![];return/^(integer|serial|smallint|bigint|smallserial|bigserial)\b/[_0x3b7509(0x1d7)](sqlTypeOf(_0x5cbeda));}function isNumericCol(_0x412fd2){const _0x4dfec1=_0x1acde2,_0x57fd10=columnTypeOf(_0x412fd2);if(_0x57fd10===_0x4dfec1(0x1dc)||_0x57fd10===_0x4dfec1(0x1fd)||_0x57fd10===_0x4dfec1(0x1e5))return!![];return/^(numeric|decimal|double|real)\b/[_0x4dfec1(0x1d7)](sqlTypeOf(_0x412fd2));}function isBooleanCol(_0x391909){const _0x32464f=_0x1acde2;return columnTypeOf(_0x391909)===_0x32464f(0x1ff)||_0x391909['type']===_0x32464f(0x1e9)||sqlTypeOf(_0x391909)[_0x32464f(0x1cc)](_0x32464f(0x1e9));}function numberPrecision(_0x5b1924){const _0x5d9543=_0x1acde2;if(isIntegerCol(_0x5b1924))return 0x0;if(typeof _0x5b1924[_0x5d9543(0x1e4)]===_0x5d9543(0x1e1))return _0x5b1924[_0x5d9543(0x1e4)];return 0x2;}export function mergeByProp(_0x56aaa6,_0x4c8c1a){const _0x408f1a=_0x1acde2,_0x1c8099=_0x4c8c1a[_0x408f1a(0x1cb)](_0x50862b=>Boolean(_0x50862b[_0x408f1a(0x1c5)])),_0x12dc32=_0x4c8c1a[_0x408f1a(0x1cb)](_0x277f86=>!_0x277f86[_0x408f1a(0x1c5)]&&_0x277f86[_0x408f1a(0x1d9)]),_0xb2dc0=new Map(_0x1c8099['map'](_0x267b81=>[String(_0x267b81[_0x408f1a(0x1c5)]),_0x267b81])),_0x1486b5=new Set(_0x12dc32[_0x408f1a(0x1d1)](_0x2482db=>String(_0x2482db[_0x408f1a(0x1d9)]))),_0x1d5702=new Set(),_0xc3490=[];for(const _0x5b60e2 of _0x56aaa6){if(!_0x5b60e2[_0x408f1a(0x1c5)]&&_0x5b60e2['type']){if(_0x1486b5['has'](String(_0x5b60e2[_0x408f1a(0x1d9)])))continue;_0xc3490['push'](_0x5b60e2);continue;}if(!_0x5b60e2[_0x408f1a(0x1c5)])continue;const _0x2c2337=String(_0x5b60e2['prop']),_0x286840=_0xb2dc0[_0x408f1a(0x1f0)](_0x2c2337);_0x286840?(_0xc3490[_0x408f1a(0x1f2)]({..._0x5b60e2,..._0x286840}),_0x1d5702[_0x408f1a(0x1fb)](_0x2c2337)):_0xc3490['push'](_0x5b60e2);}for(const _0x706584 of _0x1c8099){const _0x3b27ae=String(_0x706584['prop']);if(!_0x1d5702[_0x408f1a(0x1e7)](_0x3b27ae))_0xc3490[_0x408f1a(0x1f2)](_0x706584);}return _0xc3490['push'](..._0x12dc32),_0xc3490;}export function sortRequiredFirst(_0x2c5279){const _0x26b5a2=_0x1acde2,_0x4f0f08=[],_0x541170=[];for(const _0x55a994 of _0x2c5279){_0x55a994[_0x26b5a2(0x1e8)]===!![]||typeof _0x55a994[_0x26b5a2(0x1e8)]===_0x26b5a2(0x1f9)?_0x4f0f08[_0x26b5a2(0x1f2)](_0x55a994):_0x541170[_0x26b5a2(0x1f2)](_0x55a994);}return[..._0x4f0f08,..._0x541170];}function _0x4f05(){const _0x2c8b78=['AwDUB3jLrMLLBgrZ','C3rHDhvZ','EwvZx25Vx251BwjLCG','mZC3nZq0oevTv3nQEq','DM0TC3DPDgnO','mJi3tK5Uzwrc','zNvUy3rPB24','zgLJDa','ywrK','C2vSzwn0Aw9U','ugDeB3vIBgvqCMvJAxnPB24','ugDjBNrLz2vY','ugDcB29SzwfU','ChjVCgvYDhLoyw1L','ugDcAwDjBNq','ChjVCa','nxbgrgnLyG','mtaWmJmXnMf1rKTjva','BNvSBgfIBgu','ugDuzxH0','BgfIzwW','zMLSDgvY','C3rHCNrZv2L0Aa','mZztz2PeqNC','AgfZrgvMyxvSDa','ohHzCgvfqW','mJC1mdK0ouLYtfvQtG','BwfW','mJGWnhHNwwzJuG','EwvZx25Vx2jVB2XLyw4','ugDtzxjPywW','Dgv4Da','nZe4nduWofP3AxvmvG','DgvZDa','C2vSzwn0','DhLWzq','zgvSzxrL','BMfTzxnWywnL','ugDoDw1LCMLJ','y29SDw1UCW','zgvSzxrLvgLTzq','nZGWmteXDhzstuLy','DMfSDwu','BNvTyMvY','y29SDw1UvhLWzq','C3DPDgnO','C2nHBgu','ugDszwfS','ugDtBwfSBfnLCMLHBa','AgfZ','CMvXDwLYzwq','yM9VBgvHBG','y3jLyxrLvgLTzq','Dg9mB3DLCKnHC2u','odaZntGXmhD5wuzxta','C3fSvhLWzq','C291CMnL','zwrPDa','z2v0','mJjUs3LXEg0','ChvZAa'];_0x4f05=function(){return _0x2c8b78;};return _0x4f05();}export function buildAutoUpsertItems(_0x4ab408,_0x50dc00={}){const _0x509acf=_0x1acde2,_0x14b2f2=new Set([...UPSERT_BUILTIN_IGNORE,..._0x50dc00[_0x509acf(0x1f3)]||[]]),_0x4464d8=[];for(const _0x266a59 of epsColumns(_0x4ab408)){const _0x4a035e=_0x266a59[_0x509acf(0x200)];if(_0x14b2f2['has'](_0x4a035e))continue;const _0x46a9a0=_0x266a59['comment']||_0x4a035e,_0x485fc2=dictKeyOf(_0x266a59),_0x277d99=_0x266a59[_0x509acf(0x1c8)]===![]&&_0x266a59[_0x509acf(0x1ce)]!==!![],_0x30985a={'prop':_0x4a035e,'label':_0x46a9a0,'span':0xc,..._0x277d99?{'required':!![]}:{}};if(_0x4a035e===_0x509acf(0x1f4)){const _0xbbb03d=_0x485fc2||_0x509acf(0x1f4);isSwitchDict(_0xbbb03d)?_0x4464d8[_0x509acf(0x1f2)](switchFormItem(_0x30985a,_0xbbb03d,switchDefaultValue(_0xbbb03d))):_0x4464d8[_0x509acf(0x1f2)]({..._0x30985a,'type':_0x509acf(0x1d8),'dict':_0xbbb03d,'value':0x1});continue;}if(_0x485fc2){isSwitchDict(_0x485fc2)?_0x4464d8['push'](switchFormItem(_0x30985a,_0x485fc2,switchDefaultValue(_0x485fc2))):_0x4464d8['push']({..._0x30985a,'type':'select','dict':_0x485fc2,'value':0x0});continue;}if(isTextCol(_0x266a59)){_0x4464d8[_0x509acf(0x1f2)]({..._0x30985a,'type':'textarea','span':0xc});continue;}if(isBooleanCol(_0x266a59)){_0x4464d8[_0x509acf(0x1f2)]({..._0x30985a,'type':_0x509acf(0x1e3),'value':![],'component':{'props':()=>mapDictOptions(_0x509acf(0x1d3))},'dict':_0x509acf(0x1d3)});continue;}if(isIntegerCol(_0x266a59)||isNumericCol(_0x266a59)){const _0x529ebe=numberPrecision(_0x266a59);_0x4464d8[_0x509acf(0x1f2)]({..._0x30985a,'type':_0x509acf(0x1e1),'component':{'props':{'type':'number','precision':_0x529ebe,'controls':![]}}});continue;}_0x4464d8['push']({..._0x30985a,'type':'input'});}return _0x4464d8;}export function buildAutoTableColumns(_0x5c5f65,_0x275c9d={}){const _0x4835f1=_0x1acde2,_0x1d2f47=new Set([...TABLE_BUILTIN_IGNORE,..._0x275c9d[_0x4835f1(0x1f3)]||[]]),_0x55e90d=[];!_0x1d2f47[_0x4835f1(0x1e7)](_0x4835f1(0x1fc))&&_0x55e90d['push']({'type':'selection','width':0x32});for(const _0x3d69bf of epsColumns(_0x5c5f65)){const _0x834504=_0x3d69bf[_0x4835f1(0x200)];if(_0x1d2f47[_0x4835f1(0x1e7)](_0x834504))continue;const _0x4b512a=_0x3d69bf['comment']||_0x834504,_0x1065ac=dictKeyOf(_0x3d69bf);if(_0x834504==='status'){const _0x2031ff=_0x1065ac||'status';isSwitchDict(_0x2031ff)?_0x55e90d[_0x4835f1(0x1f2)]({'prop':_0x834504,'label':_0x4b512a,'width':0x50,'fixed':'right','component':{'name':_0x4835f1(0x1f7),'props':()=>mapDictOptions(_0x2031ff)}}):_0x55e90d['push']({'prop':_0x834504,'label':_0x4b512a,'width':0x64,'fixed':'right','dict':()=>mapDictOptions(_0x2031ff)});continue;}if(_0x1065ac&&isSwitchDict(_0x1065ac)){_0x55e90d[_0x4835f1(0x1f2)]({'prop':_0x834504,'label':_0x4b512a,'width':0x50,'component':{'name':_0x4835f1(0x1f7),'props':()=>mapDictOptions(_0x1065ac)}});continue;}if(_0x834504==='id'){_0x55e90d[_0x4835f1(0x1f2)]({'prop':_0x834504,'label':_0x4b512a,'width':0x50});continue;}if(_0x834504===_0x4835f1(0x1ea)){_0x55e90d[_0x4835f1(0x1f2)]({'prop':_0x834504,'label':_0x4b512a,'width':0xa0});continue;}if(_0x1065ac){_0x55e90d['push']({'prop':_0x834504,'label':_0x4b512a,'minWidth':0x78,'dict':()=>mapDictOptions(_0x1065ac)});continue;}if(isTextCol(_0x3d69bf)){_0x55e90d[_0x4835f1(0x1f2)]({'prop':_0x834504,'label':_0x4b512a,'minWidth':0xa0,'showOverflowTooltip':!![]});continue;}_0x55e90d['push']({'prop':_0x834504,'label':_0x4b512a,'minWidth':0x78});}return!_0x1d2f47[_0x4835f1(0x1e7)]('op')&&_0x55e90d[_0x4835f1(0x1f2)]({'type':'op','buttons':[_0x4835f1(0x1ef),_0x4835f1(0x1da)]}),_0x55e90d;}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
|
+
import { crudLabel } from '../style'
|
|
28
29
|
import { computed, ref } from 'vue'
|
|
29
30
|
import VmPreviewViewer from './vm-preview-viewer.vue'
|
|
30
31
|
|
|
@@ -59,7 +60,7 @@ const displayName = computed(() => {
|
|
|
59
60
|
|
|
60
61
|
const fallbackText = computed(() => displayName.value.slice(0, 1).toUpperCase())
|
|
61
62
|
|
|
62
|
-
const title = computed(() => displayName.value || '
|
|
63
|
+
const title = computed(() => displayName.value || crudLabel('avatar'))
|
|
63
64
|
const boxStyle = computed(() => ({
|
|
64
65
|
width: `${props.size}px`,
|
|
65
66
|
height: `${props.size}px`,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
type="button"
|
|
10
10
|
class="vm-color-picker__swatch"
|
|
11
11
|
:disabled="disabled"
|
|
12
|
-
:title="disabled ? undefined : '
|
|
12
|
+
:title="disabled ? undefined : crudLabel('pickColor')"
|
|
13
13
|
@click="toggle"
|
|
14
14
|
>
|
|
15
15
|
<span
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
role="tab"
|
|
62
62
|
@click="panelMode = 'theme'"
|
|
63
63
|
>
|
|
64
|
-
|
|
64
|
+
{{ crudLabel('theme') }}
|
|
65
65
|
</button>
|
|
66
66
|
<button
|
|
67
67
|
type="button"
|
|
@@ -70,15 +70,15 @@
|
|
|
70
70
|
role="tab"
|
|
71
71
|
@click="panelMode = 'picker'"
|
|
72
72
|
>
|
|
73
|
-
|
|
73
|
+
{{ crudLabel('colorPickerTab') }}
|
|
74
74
|
</button>
|
|
75
75
|
</div>
|
|
76
76
|
<span v-else class="vm-color-picker__toolbar-spacer" />
|
|
77
77
|
<button
|
|
78
78
|
type="button"
|
|
79
79
|
class="vm-color-picker__close"
|
|
80
|
-
title="
|
|
81
|
-
aria-label="
|
|
80
|
+
:title="crudLabel('dismiss')"
|
|
81
|
+
:aria-label="crudLabel('dismiss')"
|
|
82
82
|
@click="closePanel"
|
|
83
83
|
>
|
|
84
84
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true">
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
v-if="hasEyeDropper"
|
|
129
129
|
type="button"
|
|
130
130
|
class="vm-color-picker__eyedropper"
|
|
131
|
-
title="
|
|
131
|
+
:title="crudLabel('eyedropper')"
|
|
132
132
|
@click="pickEyeDropper"
|
|
133
133
|
>
|
|
134
134
|
<!-- 内联 SVG:不依赖 remixicon 字体是否已加载 -->
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
type="button"
|
|
180
180
|
class="vm-color-picker__format"
|
|
181
181
|
:class="{ 'is-open': formatOpen }"
|
|
182
|
-
title="
|
|
182
|
+
:title="crudLabel('colorFormat')"
|
|
183
183
|
@click.stop="toggleFormatMenu"
|
|
184
184
|
>
|
|
185
185
|
{{ formatLabel }}
|
|
@@ -247,7 +247,7 @@ import {
|
|
|
247
247
|
resolveCssThemeColorOptions,
|
|
248
248
|
type VmColorThemeOption,
|
|
249
249
|
} from '../../lib/theme-color-options'
|
|
250
|
-
import { getCrudConfig } from '../style'
|
|
250
|
+
import { crudLabel, getCrudConfig } from '../style'
|
|
251
251
|
|
|
252
252
|
defineOptions({ name: 'vm-color-picker' })
|
|
253
253
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<Button size="sm" variant="outline" class="h-8" @click="open = true">
|
|
4
|
-
|
|
4
|
+
{{ crudLabel('customColumns') }}
|
|
5
5
|
</Button>
|
|
6
6
|
<Dialog :open="open" @update:open="onOpenChange">
|
|
7
7
|
<DialogContent
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
@interact-outside="preventDialogOutsideClose"
|
|
13
13
|
>
|
|
14
14
|
<DialogHeader class="vm-crud-shell__head">
|
|
15
|
-
<DialogTitle class="vm-crud-shell__title"
|
|
15
|
+
<DialogTitle class="vm-crud-shell__title">{{ crudLabel('customColumns') }}</DialogTitle>
|
|
16
16
|
</DialogHeader>
|
|
17
17
|
<div class="vm-crud-shell__body">
|
|
18
18
|
<div class="vm-col-custom">
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
</div>
|
|
39
39
|
<DialogFooter class="vm-crud-shell__foot">
|
|
40
40
|
<button type="button" class="vm-crud-shell__btn is-ghost" @click="open = false">
|
|
41
|
-
|
|
41
|
+
{{ crudLabel('close') }}
|
|
42
42
|
</button>
|
|
43
43
|
<button type="button" class="vm-crud-shell__btn is-danger" @click="reset">
|
|
44
|
-
|
|
44
|
+
{{ crudLabel('reset') }}
|
|
45
45
|
</button>
|
|
46
46
|
<button type="button" class="vm-crud-shell__btn is-primary" @click="save">
|
|
47
|
-
|
|
47
|
+
{{ crudLabel('save') }}
|
|
48
48
|
</button>
|
|
49
49
|
</DialogFooter>
|
|
50
50
|
</DialogContent>
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script setup lang="ts">
|
|
56
|
+
import { crudLabel } from '../style'
|
|
56
57
|
import { ref, watch, inject } from 'vue'
|
|
57
58
|
import { preventDialogOutsideClose } from '../../lib/dialog-float'
|
|
58
59
|
import { injectTableOptions, TABLE_API_KEY } from '../key'
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
@click="copy"
|
|
8
8
|
>
|
|
9
9
|
<i :class="copying ? 'ri-loader-4-line is-spin' : icon" aria-hidden="true" />
|
|
10
|
-
<span>{{ copying ? copyingText : label }}</span>
|
|
10
|
+
<span>{{ copying ? (copyingText ?? crudLabel('copying')) : (label ?? crudLabel('copy')) }}</span>
|
|
11
11
|
</button>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup lang="ts">
|
|
15
|
+
import { crudLabel } from '../style'
|
|
15
16
|
import { ref } from 'vue'
|
|
16
17
|
|
|
17
18
|
defineOptions({ name: 'vm-copy-btn' })
|
|
@@ -26,8 +27,8 @@ const props = withDefaults(
|
|
|
26
27
|
disabled?: boolean
|
|
27
28
|
}>(),
|
|
28
29
|
{
|
|
29
|
-
label:
|
|
30
|
-
copyingText:
|
|
30
|
+
label: undefined,
|
|
31
|
+
copyingText: undefined,
|
|
31
32
|
icon: 'ri-file-copy-line',
|
|
32
33
|
size: 'md',
|
|
33
34
|
disabled: false,
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
/>
|
|
11
11
|
</button>
|
|
12
12
|
<div class="vm-dt-cal__nav">
|
|
13
|
-
<button type="button" class="vm-dt-cal__nav-btn" title="
|
|
13
|
+
<button type="button" class="vm-dt-cal__nav-btn" :title="crudLabel('prevPage')" @click="prevPage">
|
|
14
14
|
<i class="ri-arrow-up-s-line" aria-hidden="true" />
|
|
15
15
|
</button>
|
|
16
|
-
<button type="button" class="vm-dt-cal__nav-btn" title="
|
|
16
|
+
<button type="button" class="vm-dt-cal__nav-btn" :title="crudLabel('nextPage')" @click="nextPage">
|
|
17
17
|
<i class="ri-arrow-down-s-line" aria-hidden="true" />
|
|
18
18
|
</button>
|
|
19
19
|
</div>
|
|
@@ -88,14 +88,15 @@
|
|
|
88
88
|
</div>
|
|
89
89
|
|
|
90
90
|
<footer class="vm-dt-cal__foot">
|
|
91
|
-
<button type="button" class="vm-dt-cal__link" @click="emit('clear')"
|
|
92
|
-
<button type="button" class="vm-dt-cal__link" @click="pickToday"
|
|
91
|
+
<button type="button" class="vm-dt-cal__link" @click="emit('clear')">{{ crudLabel('clear') }}</button>
|
|
92
|
+
<button type="button" class="vm-dt-cal__link" @click="pickToday">{{ crudLabel('today') }}</button>
|
|
93
93
|
</footer>
|
|
94
94
|
</div>
|
|
95
95
|
</template>
|
|
96
96
|
|
|
97
97
|
<script setup lang="ts">
|
|
98
98
|
import { computed, reactive, ref, watch } from 'vue'
|
|
99
|
+
import { crudFormat, crudLabel } from '../style'
|
|
99
100
|
import {
|
|
100
101
|
buildMonthGrid,
|
|
101
102
|
clampTimePart,
|
|
@@ -125,26 +126,23 @@ const emit = defineEmits<{
|
|
|
125
126
|
|
|
126
127
|
const precision = computed(() => normalizeDateTimePrecision(props.precision))
|
|
127
128
|
const isDatetime = computed(() => precision.value === 'datetime')
|
|
128
|
-
const weekdays =
|
|
129
|
-
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
'
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
{ key: 'm' as const, label: '分', max: 59 },
|
|
146
|
-
{ key: 's' as const, label: '秒', max: 59 },
|
|
147
|
-
]
|
|
129
|
+
const weekdays = computed(() => [
|
|
130
|
+
crudLabel('weekdaySun'),
|
|
131
|
+
crudLabel('weekdayMon'),
|
|
132
|
+
crudLabel('weekdayTue'),
|
|
133
|
+
crudLabel('weekdayWed'),
|
|
134
|
+
crudLabel('weekdayThu'),
|
|
135
|
+
crudLabel('weekdayFri'),
|
|
136
|
+
crudLabel('weekdaySat'),
|
|
137
|
+
])
|
|
138
|
+
const monthLabels = computed(() =>
|
|
139
|
+
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((n) => crudLabel(`month${n}`)),
|
|
140
|
+
)
|
|
141
|
+
const timeFields = computed(() => [
|
|
142
|
+
{ key: 'h' as const, label: crudLabel('hour'), max: 23 },
|
|
143
|
+
{ key: 'm' as const, label: crudLabel('minute'), max: 59 },
|
|
144
|
+
{ key: 's' as const, label: crudLabel('second'), max: 59 },
|
|
145
|
+
])
|
|
148
146
|
|
|
149
147
|
type PanelView = 'date' | 'month' | 'year'
|
|
150
148
|
const view = ref<PanelView>('date')
|
|
@@ -179,9 +177,14 @@ const yearCells = computed(() =>
|
|
|
179
177
|
)
|
|
180
178
|
|
|
181
179
|
const headTitle = computed(() => {
|
|
182
|
-
if (view.value === 'year')
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
if (view.value === 'year')
|
|
181
|
+
return crudFormat(crudLabel('yearRange'), yearStart.value, yearStart.value + 11)
|
|
182
|
+
if (view.value === 'month') return crudFormat(crudLabel('yearLabel'), viewYear.value)
|
|
183
|
+
return crudFormat(
|
|
184
|
+
crudLabel('yearMonth'),
|
|
185
|
+
viewYear.value,
|
|
186
|
+
String(viewMonth.value + 1).padStart(2, '0'),
|
|
187
|
+
)
|
|
185
188
|
})
|
|
186
189
|
|
|
187
190
|
function currentTime() {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script setup lang="ts">
|
|
13
|
+
import { crudLabel } from '../style'
|
|
13
14
|
import { computed } from 'vue'
|
|
14
15
|
import { useCrud } from '../useCrud'
|
|
15
16
|
import VmDatetimeField from './vm-datetime-field.vue'
|
|
@@ -49,10 +50,10 @@ const TYPE_PRECISION: Record<string, DateTimePrecision> = {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
const TYPE_PLACEHOLDER: Record<string, string> = {
|
|
52
|
-
date: '
|
|
53
|
-
datetime: '
|
|
54
|
-
month: '
|
|
55
|
-
year: '
|
|
53
|
+
date: 'pickDate',
|
|
54
|
+
datetime: 'pickDateTime',
|
|
55
|
+
month: 'pickMonth',
|
|
56
|
+
year: 'pickYear',
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
const precision = computed(
|
|
@@ -60,7 +61,7 @@ const precision = computed(
|
|
|
60
61
|
)
|
|
61
62
|
|
|
62
63
|
const placeholderText = computed(
|
|
63
|
-
() => props.placeholder || TYPE_PLACEHOLDER[props.type] || '
|
|
64
|
+
() => props.placeholder || crudLabel(TYPE_PLACEHOLDER[props.type] || 'pickDate'),
|
|
64
65
|
)
|
|
65
66
|
|
|
66
67
|
function onUpdate(v: string | null) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
class="vm-date-range__field"
|
|
5
5
|
:model-value="modelValue?.[0] ?? null"
|
|
6
6
|
:precision="precision"
|
|
7
|
-
:placeholder="startPlaceholder"
|
|
7
|
+
:placeholder="startPlaceholder ?? crudLabel('startTime')"
|
|
8
8
|
:disabled="disabled"
|
|
9
9
|
@update:model-value="(v) => set(0, v)"
|
|
10
10
|
/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
class="vm-date-range__field"
|
|
14
14
|
:model-value="modelValue?.[1] ?? null"
|
|
15
15
|
:precision="precision"
|
|
16
|
-
:placeholder="endPlaceholder"
|
|
16
|
+
:placeholder="endPlaceholder ?? crudLabel('endTime')"
|
|
17
17
|
:disabled="disabled"
|
|
18
18
|
@update:model-value="(v) => set(1, v)"
|
|
19
19
|
/>
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script setup lang="ts">
|
|
24
|
+
import { crudLabel } from '../style'
|
|
24
25
|
import VmDatetimeField from './vm-datetime-field.vue'
|
|
25
26
|
import type { DateTimePrecision } from '../../../shared/datetime-picker'
|
|
26
27
|
|
|
@@ -37,8 +38,8 @@ const props = withDefaults(
|
|
|
37
38
|
}>(),
|
|
38
39
|
{
|
|
39
40
|
precision: 'day',
|
|
40
|
-
startPlaceholder:
|
|
41
|
-
endPlaceholder:
|
|
41
|
+
startPlaceholder: undefined,
|
|
42
|
+
endPlaceholder: undefined,
|
|
42
43
|
},
|
|
43
44
|
)
|
|
44
45
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
@click="onRootClick"
|
|
7
7
|
>
|
|
8
8
|
<div class="vm-dt-field__box">
|
|
9
|
-
<span v-if="!displayText
|
|
10
|
-
placeholder
|
|
9
|
+
<span v-if="!displayText" class="vm-dt-field__ph">{{
|
|
10
|
+
placeholder ?? crudLabel('pickDateTime')
|
|
11
11
|
}}</span>
|
|
12
12
|
<span class="vm-dt-field__val">{{ displayText }}</span>
|
|
13
13
|
</div>
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
</template>
|
|
43
43
|
|
|
44
44
|
<script setup lang="ts">
|
|
45
|
+
import { crudLabel } from '../style'
|
|
45
46
|
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
46
47
|
import { FocusScope } from 'reka-ui'
|
|
47
48
|
import VmDateCalendarPanel from './vm-date-calendar-panel.vue'
|
|
@@ -64,7 +65,7 @@ const props = withDefaults(
|
|
|
64
65
|
{
|
|
65
66
|
modelValue: null,
|
|
66
67
|
precision: 'day',
|
|
67
|
-
placeholder:
|
|
68
|
+
placeholder: undefined,
|
|
68
69
|
disabled: false,
|
|
69
70
|
},
|
|
70
71
|
)
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
|
+
import { crudLabel } from '../style'
|
|
6
7
|
import { computed } from 'vue'
|
|
7
8
|
import { prettyJson } from '../../lib/json'
|
|
8
9
|
|
|
@@ -14,11 +15,11 @@ const props = withDefaults(
|
|
|
14
15
|
empty?: string
|
|
15
16
|
}>(),
|
|
16
17
|
{
|
|
17
|
-
empty:
|
|
18
|
+
empty: undefined,
|
|
18
19
|
},
|
|
19
20
|
)
|
|
20
21
|
|
|
21
|
-
const body = computed(() => prettyJson(props.modelValue, props.empty))
|
|
22
|
+
const body = computed(() => prettyJson(props.modelValue, props.empty ?? crudLabel('jsonEmpty')))
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
25
|
<style lang="scss" scoped>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="{ 'is-error': Boolean(error) }"
|
|
6
6
|
:value="inner"
|
|
7
7
|
:disabled="disabled"
|
|
8
|
-
:placeholder="placeholder"
|
|
8
|
+
:placeholder="placeholder ?? crudLabel('jsonPlaceholder')"
|
|
9
9
|
:rows="fill ? undefined : rows"
|
|
10
10
|
@input="onInput"
|
|
11
11
|
@blur="validate"
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script setup lang="ts">
|
|
18
|
+
import { crudLabel } from '../style'
|
|
18
19
|
import { ref, watch } from 'vue'
|
|
19
20
|
import { parseJsonInput, prettyJson, textOfJson } from '../../lib/json'
|
|
20
21
|
|
|
@@ -32,7 +33,7 @@ const props = withDefaults(
|
|
|
32
33
|
fill?: boolean
|
|
33
34
|
}>(),
|
|
34
35
|
{
|
|
35
|
-
placeholder:
|
|
36
|
+
placeholder: undefined,
|
|
36
37
|
rows: 8,
|
|
37
38
|
formatOnBlur: true,
|
|
38
39
|
fill: false,
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
:filterable="false"
|
|
26
26
|
:refresh-on-change="false"
|
|
27
27
|
width="110px"
|
|
28
|
-
placeholder="
|
|
28
|
+
:placeholder="crudLabel('jsonType')"
|
|
29
29
|
@update:model-value="(v) => onKindChange(index, String(v))"
|
|
30
30
|
/>
|
|
31
31
|
<input
|
|
32
32
|
v-if="row.valueKind === 'string' || row.valueKind === 'number'"
|
|
33
33
|
class="vm-json-kv__value"
|
|
34
34
|
:value="row.stringValue"
|
|
35
|
-
:placeholder="row.valueKind === 'number' ? '
|
|
35
|
+
:placeholder="row.valueKind === 'number' ? crudLabel('jsonNumber') : 'value'"
|
|
36
36
|
:type="row.valueKind === 'number' ? 'number' : 'text'"
|
|
37
37
|
@input="
|
|
38
38
|
patchRow(index, {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
@update:model-value="(v) => patchRow(index, { stringValue: String(v) })"
|
|
52
52
|
/>
|
|
53
53
|
<div v-else class="vm-json-kv__value-spacer" />
|
|
54
|
-
<div class="vm-json-kv__app" title="
|
|
54
|
+
<div class="vm-json-kv__app" :title="crudLabel('openToApp')">
|
|
55
55
|
<vm-switch
|
|
56
56
|
:model-value="row.openToApp"
|
|
57
57
|
:active-value="true"
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
<vm-icon-btn
|
|
63
63
|
v-if="row.valueKind === 'object'"
|
|
64
64
|
icon="ri-add-line"
|
|
65
|
-
title="
|
|
65
|
+
:title="crudLabel('addChildKv')"
|
|
66
66
|
size="sm"
|
|
67
67
|
@click="addChild(index)"
|
|
68
68
|
/>
|
|
69
69
|
<vm-icon-btn
|
|
70
70
|
icon="ri-delete-bin-line"
|
|
71
|
-
title="
|
|
71
|
+
:title="crudLabel('delete')"
|
|
72
72
|
size="sm"
|
|
73
73
|
variant="danger"
|
|
74
74
|
@click="removeRow(index)"
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
</template>
|
|
88
88
|
|
|
89
89
|
<script setup lang="ts">
|
|
90
|
+
import { crudLabel } from '../style'
|
|
90
91
|
import { computed, toValue, type MaybeRefOrGetter } from 'vue'
|
|
91
92
|
import type { JsonKvNode, JsonValueKind } from '../json-kv'
|
|
92
93
|
import VmSelect from './vm-select.vue'
|
|
@@ -109,17 +110,17 @@ const emit = defineEmits<{
|
|
|
109
110
|
'update:modelValue': [JsonKvNode[]]
|
|
110
111
|
}>()
|
|
111
112
|
|
|
112
|
-
const defaultKindOptions = [
|
|
113
|
-
{ label: '
|
|
114
|
-
{ label: '
|
|
115
|
-
{ label: '
|
|
116
|
-
{ label: '
|
|
117
|
-
]
|
|
113
|
+
const defaultKindOptions = computed(() => [
|
|
114
|
+
{ label: crudLabel('jsonText'), value: 'string' },
|
|
115
|
+
{ label: crudLabel('jsonNumber'), value: 'number' },
|
|
116
|
+
{ label: crudLabel('jsonBoolean'), value: 'boolean' },
|
|
117
|
+
{ label: crudLabel('jsonObject'), value: 'object' },
|
|
118
|
+
])
|
|
118
119
|
|
|
119
120
|
/** 平铺为 label/value;不走索引搜索(filterable=false) */
|
|
120
121
|
const kindOptions = computed(() => {
|
|
121
122
|
const list = toValue(props.kindOptions)
|
|
122
|
-
const raw = list?.length ? list : defaultKindOptions
|
|
123
|
+
const raw = list?.length ? list : defaultKindOptions.value
|
|
123
124
|
return raw.map((opt) => ({
|
|
124
125
|
label: String(opt.label ?? opt.name ?? opt.value ?? ''),
|
|
125
126
|
value: opt.value as string | number,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
/>
|
|
45
45
|
<span>{{ opt.label }}</span>
|
|
46
46
|
</label>
|
|
47
|
-
<div v-if="!options.length" class="vm-multi-select__empty"
|
|
47
|
+
<div v-if="!options.length" class="vm-multi-select__empty">{{ crudLabel('noOptions') }}</div>
|
|
48
48
|
</div>
|
|
49
49
|
</FocusScope>
|
|
50
50
|
</Teleport>
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup lang="ts">
|
|
55
|
+
import { crudFormat, crudLabel } from '../style'
|
|
55
56
|
import { ref, computed, nextTick, onMounted, onUnmounted } from 'vue'
|
|
56
57
|
import { FocusScope } from 'reka-ui'
|
|
57
58
|
import { POPUP_TRIGGER_GAP } from '../../lib/dialog-float'
|
|
@@ -69,7 +70,7 @@ const props = withDefaults(
|
|
|
69
70
|
{
|
|
70
71
|
modelValue: () => [],
|
|
71
72
|
options: () => [],
|
|
72
|
-
placeholder:
|
|
73
|
+
placeholder: undefined,
|
|
73
74
|
},
|
|
74
75
|
)
|
|
75
76
|
|
|
@@ -96,13 +97,13 @@ function normalizeMulti(
|
|
|
96
97
|
const selected = computed(() => normalizeMulti(props.modelValue))
|
|
97
98
|
|
|
98
99
|
const triggerText = computed(() => {
|
|
99
|
-
if (!selected.value.length) return props.placeholder
|
|
100
|
+
if (!selected.value.length) return props.placeholder ?? crudLabel('pleaseSelect')
|
|
100
101
|
const labels = selected.value.map((v) => {
|
|
101
102
|
const hit = props.options.find((o) => String(o.value) === String(v))
|
|
102
103
|
return hit?.label ?? String(v)
|
|
103
104
|
})
|
|
104
105
|
if (labels.length <= 2) return labels.join('、')
|
|
105
|
-
return
|
|
106
|
+
return crudFormat(crudLabel('selectedCount'), labels.length)
|
|
106
107
|
})
|
|
107
108
|
|
|
108
109
|
function isChecked(v: string | number | boolean) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
class="vm-number-range__input"
|
|
6
6
|
:type="mode === 'float' ? 'text' : 'number'"
|
|
7
7
|
inputmode="decimal"
|
|
8
|
-
:placeholder="startPlaceholder"
|
|
8
|
+
:placeholder="startPlaceholder ?? crudLabel('min')"
|
|
9
9
|
:disabled="disabled"
|
|
10
10
|
:value="display(0)"
|
|
11
11
|
@input="(e) => onInput(0, e)"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
class="vm-number-range__input"
|
|
20
20
|
:type="mode === 'float' ? 'text' : 'number'"
|
|
21
21
|
inputmode="decimal"
|
|
22
|
-
:placeholder="endPlaceholder"
|
|
22
|
+
:placeholder="endPlaceholder ?? crudLabel('max')"
|
|
23
23
|
:disabled="disabled"
|
|
24
24
|
:value="display(1)"
|
|
25
25
|
@input="(e) => onInput(1, e)"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
|
+
import { crudLabel } from '../style'
|
|
34
35
|
defineOptions({ name: 'vm-number-range' })
|
|
35
36
|
|
|
36
37
|
const props = withDefaults(
|
|
@@ -44,8 +45,8 @@ const props = withDefaults(
|
|
|
44
45
|
}>(),
|
|
45
46
|
{
|
|
46
47
|
mode: 'int',
|
|
47
|
-
startPlaceholder:
|
|
48
|
-
endPlaceholder:
|
|
48
|
+
startPlaceholder: undefined,
|
|
49
|
+
endPlaceholder: undefined,
|
|
49
50
|
},
|
|
50
51
|
)
|
|
51
52
|
|