@utogether/udp-core 1.0.0 → 1.0.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/build/plugins.ts +8 -2
  2. package/dist/{403-B1R-4vXw.js → 403-BBQoJwTM.js} +9 -8
  3. package/dist/{404-fXPl8csw.js → 404-BbJPSIWM.js} +15 -14
  4. package/dist/{500-eI5842YB.js → 500-BtFL9R4M.js} +11 -10
  5. package/dist/{AuthorityInfo-CfVH6PaB.js → AuthorityInfo-DhiwCeLN.js} +1 -1
  6. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js → AuthorityInfo.vue_vue_type_style_index_0_lang-Duyweh89.js} +3 -3
  7. package/dist/{AuthorityPanel-BaLMwMgW.js → AuthorityPanel-BeBNiwqc.js} +1 -1
  8. package/dist/{AuthorityPanel.vue_vue_type_style_index_0_lang-C_bkqLD9.js → AuthorityPanel.vue_vue_type_style_index_0_lang-CIYmnP9-.js} +6 -6
  9. package/dist/{Company-CYC9Avfz.js → Company-CGqmslx-.js} +3 -3
  10. package/dist/{CompanyPanel-B4MzoqN_.js → CompanyPanel-hlDsxD-6.js} +10 -10
  11. package/dist/{Department-B4BNSiYx.js → Department-BZyJtacc.js} +3 -3
  12. package/dist/{DepartmentPanel-zJO89L2O.js → DepartmentPanel-D-a_EBFt.js} +23 -23
  13. package/dist/{DesignPanel-S8P0J97f.js → DesignPanel-Bl4luWDV.js} +1 -1
  14. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DW-_Vqrr.js → DesignPanel.vue_vue_type_style_index_0_lang-I8C3iGvz.js} +6 -6
  15. package/dist/{DictView-bIS5-rK-.js → DictView-B4a7Hs1X.js} +9 -9
  16. package/dist/InvOrganization-q4T3y8dQ.js +260 -0
  17. package/dist/{Org-kXHSjsgJ.js → Org-BTGTrAVz.js} +3 -3
  18. package/dist/{Preview-CRyiwUIR.js → Preview-pHD84xqI.js} +1 -1
  19. package/dist/{ReportDefine-WZYIx8Sm.js → ReportDefine-DnnCNQWS.js} +1 -1
  20. package/dist/{ReportDesign-D-7GKgpb.js → ReportDesign-BnI_Q4pg.js} +10 -10
  21. package/dist/{ReportQuery-BIIJny6w.js → ReportQuery-Dby2MmtM.js} +5 -5
  22. package/dist/{ReportQueryFrom-OoUl7N2O.js → ReportQueryFrom-Blm1N8P1.js} +1 -1
  23. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CnG_Ybnt.js} +6 -5
  24. package/dist/{ReportTemplate-Cfeq9US-.js → ReportTemplate-D65RXRY_.js} +11 -11
  25. package/dist/{Role-BwTV2QMH.js → Role-eFZoTpXc.js} +3 -3
  26. package/dist/{RoleAssign-De1JjOun.js → RoleAssign-D9-Y3UNz.js} +3 -3
  27. package/dist/{RolePanel-pUBXsqCM.js → RolePanel-CoUOc3sX.js} +1 -1
  28. package/dist/{RolePanel-E3RcdByM.js → RolePanel-DlFw6HSf.js} +1 -1
  29. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js → RolePanel.vue_vue_type_script_setup_true_lang-Clwk-MHw.js} +12 -12
  30. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js → RolePanel.vue_vue_type_script_setup_true_lang-DKHgNWQP.js} +4 -4
  31. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js → ScrollPanel.vue_vue_type_style_index_0_lang-M2FQJwPU.js} +8 -8
  32. package/dist/{Staff-Czm7A8vI.js → Staff-DFBLCsAd.js} +3 -3
  33. package/dist/StaffInfo-d2CK0oBA.js +4 -0
  34. package/dist/{StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js → StaffInfo.vue_vue_type_script_setup_true_lang-4m8wK9tq.js} +7 -7
  35. package/dist/{StaffPanel-CHk60LEz.js → StaffPanel-D6aWLKN3.js} +1 -1
  36. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js → StaffPanel.vue_vue_type_script_setup_true_lang-C7YT2CVb.js} +46 -49
  37. package/dist/{SysUser-BGwbttRn.js → SysUser-BdZvYxQH.js} +2 -2
  38. package/dist/{SysUserPanel-BCbKoLKt.js → SysUserPanel-BIVa6LLr.js} +1 -1
  39. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BsBKpYR7.js} +1 -2
  40. package/dist/{SystemMenu-BkqZSDKl.js → SystemMenu-C-5VKlHK.js} +51 -49
  41. package/dist/{UserInfo-BsyAcT2d.js → UserInfo-DqXCRZts.js} +1 -1
  42. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-D0-KDxAh.js → UserInfo.vue_vue_type_style_index_0_lang-N3TwfpPx.js} +13 -13
  43. package/dist/{childView-CyuLTUqC.js → childView-B2lSsqS3.js} +1 -1
  44. package/dist/{childView-CF83nhxb.js → childView-DRUNqgjI.js} +1 -1
  45. package/dist/{childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js → childView.vue_vue_type_style_index_0_lang-B9XBDDU_.js} +1 -1
  46. package/dist/{childView.vue_vue_type_style_index_0_lang-CNSgGda3.js → childView.vue_vue_type_style_index_0_lang-oGriyFTv.js} +6 -6
  47. package/dist/{code-rule-Bz-gnktN.js → code-rule-DZC9T6cl.js} +6 -6
  48. package/dist/core.es.js +4 -4
  49. package/dist/{cron-task-CIifSUdW.js → cron-task-BJwPeA5F.js} +11 -11
  50. package/dist/{frameView-_d2mqjjQ.js → frameView-C6wkvok-.js} +15 -14
  51. package/dist/index-DZc3qRTx.js +2650 -0
  52. package/dist/{layoutView-DLKVepB8.js → layoutView-CeJBpZb_.js} +658 -653
  53. package/dist/{login-LREiDfFU.js → login-BOxwzwdB.js} +26 -25
  54. package/dist/{lov-view-DDrIVILB.js → lov-view-DRF-99U4.js} +5 -5
  55. package/dist/{menuInfo-B1FUV-Sk.js → menuInfo-3Sjvs9nM.js} +1 -1
  56. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js → menuInfo.vue_vue_type_style_index_0_lang-DrQ560nm.js} +95 -94
  57. package/dist/pda-app-B9tn7jdv.js +696 -0
  58. package/dist/redirect-BqegffKC.js +15 -0
  59. package/dist/{resource-BCwx9fEv.js → resource-BqnxbQNe.js} +7 -7
  60. package/dist/{su-welcome-189A7N4r.js → su-welcome-VwifUK_O.js} +41 -40
  61. package/dist/{sys-config-BZ3sejow.js → sys-config-C0-gSBFO.js} +18 -18
  62. package/dist/udp-core.css +2 -2
  63. package/dist/{utogether-r08LNiIZ.js → utogether-Di1byIum.js} +6 -6
  64. package/package.json +18 -16
  65. package/src/App.vue +3 -3
  66. package/src/components/udp/form-upload.vue +183 -0
  67. package/src/components/udp/index.ts +4 -0
  68. package/src/components/udp/modal-form.vue +180 -0
  69. package/src/components/udp/utils.ts +40 -0
  70. package/src/main.ts +109 -108
  71. package/src/plugins/vxe-table/index.ts +53 -46
  72. package/src/plugins/vxe-table/render.tsx +604 -184
  73. package/src/utils/udp/useRender.ts +420 -0
  74. package/src/views/organization/inv-org/InvOrganization.vue +2 -1
  75. package/src/views/organization/staff/StaffInfo.vue +0 -30
  76. package/src/views/organization/staff/StaffPanel.vue +4 -3
  77. package/src/views/system/menu/AuthorityPanel.vue +2 -2
  78. package/src/views/system/menu/SystemMenu.vue +197 -191
  79. package/src/views/system/menu/menuInfo.vue +11 -6
  80. package/src/views/system/role/AuthorityInfo.vue +1 -19
  81. package/src/views/system/sysUser/SysUserPanel.vue +1 -1
  82. package/src/views/udev/dict/DictView.vue +2 -2
  83. package/src/views/uhome/components/menu-favorite.vue +1 -1
  84. package/src/views/uhome/su-welcome.vue +1 -1
  85. package/src/views/ulogin/login.vue +1 -1
  86. package/types/global.d.ts +0 -1
  87. package/vite.config.ts +9 -2
  88. package/dist/InvOrganization-MuM2jtsG.js +0 -66
  89. package/dist/StaffInfo-DJzvBuxy.js +0 -4
  90. package/dist/core.umd.js +0 -173
  91. package/dist/index-BKIw8tSn.js +0 -9195
  92. package/dist/pda-app-CRhVGijN.js +0 -2209
  93. package/dist/redirect-DiaNDu8F.js +0 -15
  94. package/src/assets/images/empty.png +0 -0
  95. package/src/assets/images/logo.png +0 -0
  96. package/src/components/ReCountTo/README.md +0 -2
  97. package/src/components/ReCountTo/index.ts +0 -18
  98. package/src/components/ReCountTo/src/normal/index.tsx +0 -165
  99. package/src/components/ReCountTo/src/normal/props.ts +0 -37
  100. package/src/components/ReCountTo/src/rebound/index.tsx +0 -67
  101. package/src/components/ReCountTo/src/rebound/props.ts +0 -14
  102. package/src/components/ReCountTo/src/rebound/rebound.css +0 -77
  103. package/src/components/ReCropper/index.ts +0 -14
  104. package/src/components/ReCropper/src/index.tsx +0 -141
  105. package/src/components/ReFlicker/index.css +0 -39
  106. package/src/components/ReFlicker/index.ts +0 -50
  107. package/src/components/ReFlop/index.ts +0 -14
  108. package/src/components/ReFlop/src/Filpper.tsx +0 -99
  109. package/src/components/ReFlop/src/filpper.css +0 -184
  110. package/src/components/ReFlop/src/index.vue +0 -126
  111. package/src/components/ReFlowChart/index.ts +0 -24
  112. package/src/components/ReFlowChart/src/Control.vue +0 -139
  113. package/src/components/ReFlowChart/src/DataDialog.vue +0 -12
  114. package/src/components/ReFlowChart/src/NodePanel.vue +0 -151
  115. package/src/components/ReFlowChart/src/adpterForTurbo.ts +0 -160
  116. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +0 -49
  117. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
  118. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +0 -61
  119. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +0 -58
  120. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +0 -47
  121. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
  122. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
  123. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
  124. package/src/components/ReFlowChart/src/config.ts +0 -62
  125. package/src/components/ReSplitPane/index.css +0 -49
  126. package/src/components/ReSplitPane/index.tsx +0 -119
  127. package/src/components/ReSplitPane/resizer.css +0 -45
  128. package/src/components/ReSplitPane/resizer.tsx +0 -30
  129. package/src/components/SuCommon/card/components/Card.vue +0 -148
  130. package/src/components/SuCommon/card/components/DialogForm.vue +0 -127
  131. package/src/components/SuCommon/card/index.vue +0 -142
  132. package/src/components/SuCommon/icon-select/index.vue +0 -241
  133. package/src/components/SuCommon/table/index.vue +0 -208
  134. package/src/components/SuCommon/utils/index.ts +0 -103
  135. package/src/components/SuCommon/utils/slot.tsx +0 -50
  136. package/src/views/components/contextmenu/basic.vue +0 -74
  137. package/src/views/components/contextmenu/context-menu.vue +0 -40
  138. package/src/views/components/contextmenu/menuDynamic.vue +0 -99
  139. package/src/views/components/contextmenu/menuGroup.vue +0 -71
  140. package/src/views/components/count-to/index.vue +0 -43
  141. package/src/views/components/cropping/index.vue +0 -59
  142. package/src/views/components/cropping/picture.jpeg +0 -0
  143. package/src/views/components/split-pane/index.vue +0 -82
  144. package/src/views/components/video/index.vue +0 -57
package/src/main.ts CHANGED
@@ -1,108 +1,109 @@
1
- /*
2
- * @Author: wei.li
3
- * @Date: 2022-10-18 18:13:54
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-04-29 15:35:32
6
- * @Description: file content
7
- */
8
- import { createApp, type Directive } from 'vue';
9
- import App from './App.vue';
10
- import router from './router';
11
- import { setViews } from './router';
12
- import { setupStore } from './store';
13
- import { setConfig, setSystemEnv } from './config';
14
- import { useI18n } from '../src/plugins/i18n';
15
- import { setTableConfig } from '../src/plugins/vxe-table';
16
- import { injectResponsiveStorage } from './utils/storage';
17
- import hasAuthority from './utils/authority';
18
- import { getServiceApi, getBaseURL, setRouter } from './api';
19
-
20
- import 'nprogress/nprogress.css';
21
- // 一定要在main.ts中导入tailwind.css,防止vite每次hmr都会请求src/style/index.scss整体css文件导致热更新慢的问题
22
- import './style/tailwind.css';
23
- // // 引入重置样式
24
- import './style/reset.scss';
25
- // 导入公共样式
26
- import './style/index.scss';
27
-
28
- import 'viewerjs/dist/viewer.css';
29
-
30
- import VueViewer from 'v-viewer';
31
-
32
- // import SuTable from './components/SuTable/SuTable.vue';
33
-
34
- // import {
35
- // UtButton,
36
- // UGrid,
37
- // UtDivider,
38
- // UtModalForm,
39
- // UtForm,
40
- // UtModalGrid,
41
- // UtContent,
42
- // UtCountdown,
43
- // UtIconSelect,
44
- // UtCalendar
45
- // uAttachment
46
- // } from './../src/components/udp';
47
-
48
- const app = createApp(App);
49
-
50
- // 全局注册`@iconify/vue`图标库
51
- import { IconifyIconOffline, FontIcon } from './components/ReIcon';
52
- // 全局注册`vue-tippy`
53
- import 'tippy.js/dist/tippy.css';
54
- import 'tippy.js/animations/perspective.css';
55
- import VueTippy from 'vue-tippy';
56
-
57
- app.use(VueTippy, {
58
- defaultProps: { animation: 'perspective' }
59
- });
60
-
61
- // 自定义指令
62
- import * as directives from './directives';
63
-
64
- const setGlobal = app => {
65
- app.config.globalProperties.$hasAuthority = hasAuthority;
66
- app.config.globalProperties.$serviceApi = getServiceApi();
67
- app.config.globalProperties.$url = getBaseURL();
68
- };
69
-
70
- const setGlobalDirective = app => {
71
- Object.keys(directives).forEach(key => {
72
- app.directive(key, (directives as { [key: string]: Directive })[key]);
73
- });
74
- };
75
- console.log('ucore--process', process.env);
76
-
77
- const init = ({ config, lang, views, env, tableConfig }) => {
78
- app.use(router);
79
- setRouter(router);
80
- setConfig(app, config);
81
- setSystemEnv(env);
82
- setViews(views);
83
- setTableConfig(tableConfig);
84
- return new Promise(resolve => {
85
- useI18n(app, lang);
86
- app.component('IconifyIconOffline', IconifyIconOffline);
87
- app.component('FontIcon', FontIcon);
88
- // app.component('uAttachment', uAttachment).component('UGrid', UGrid);
89
- // .component('UtDivider', UtDivider)
90
- // .component('UtModalForm', UtModalForm)
91
- // .component('UtForm', UtForm)
92
- // .component('UtContent', UtContent)
93
- // .component('UtIconSelect', UtIconSelect)
94
- // .component('UtCountdown', UtCountdown)
95
- // .component('UtCalendar', UtCalendar)
96
- // .component('UtModalGrid', UtModalGrid);
97
- app.use(VueViewer, { defaultOptions: { zIndex: 9999 } });
98
- setGlobal(app);
99
- setGlobalDirective(app);
100
- // 全局组件
101
- setupStore(app);
102
- injectResponsiveStorage(app, config);
103
- const result = { app, router };
104
- resolve(result);
105
- });
106
- };
107
-
108
- export default init;
1
+ /*
2
+ * @Author: wei.li
3
+ * @Date: 2022-10-18 18:13:54
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-04-29 15:35:32
6
+ * @Description: file content
7
+ */
8
+ import { createApp, type Directive } from 'vue';
9
+ import App from './App.vue';
10
+ import router from './router';
11
+ import { setViews } from './router';
12
+ import { setupStore } from './store';
13
+ import { setConfig, setSystemEnv } from './config';
14
+ import { useI18n } from '../src/plugins/i18n';
15
+ import { setTableConfig } from '../src/plugins/vxe-table';
16
+ import { injectResponsiveStorage } from './utils/storage';
17
+ import hasAuthority from './utils/authority';
18
+ import { getServiceApi, getBaseURL, setRouter } from './api';
19
+
20
+ import 'nprogress/nprogress.css';
21
+ // 一定要在main.ts中导入tailwind.css,防止vite每次hmr都会请求src/style/index.scss整体css文件导致热更新慢的问题
22
+ import './style/tailwind.css';
23
+ // // 引入重置样式
24
+ import './style/reset.scss';
25
+ // 导入公共样式
26
+ import './style/index.scss';
27
+
28
+ import 'viewerjs/dist/viewer.css';
29
+
30
+ import VueViewer from 'v-viewer';
31
+
32
+ // import SuTable from './components/SuTable/SuTable.vue';
33
+
34
+ // import {
35
+ // UtButton,
36
+ // UGrid,
37
+ // UtDivider,
38
+ // UtModalForm2,
39
+ // FormUpload2
40
+ // UtForm,
41
+ // UtModalGrid,
42
+ // UtContent,
43
+ // UtCountdown,
44
+ // UtIconSelect,
45
+ // UtCalendar
46
+ // uAttachment
47
+ // } from './components/udp';
48
+
49
+ const app = createApp(App);
50
+
51
+ // 全局注册`@iconify/vue`图标库
52
+ import { IconifyIconOffline, FontIcon } from './components/ReIcon';
53
+ // 全局注册`vue-tippy`
54
+ import 'tippy.js/dist/tippy.css';
55
+ import 'tippy.js/animations/perspective.css';
56
+ import VueTippy from 'vue-tippy';
57
+
58
+ app.use(VueTippy, {
59
+ defaultProps: { animation: 'perspective' }
60
+ });
61
+
62
+ // 自定义指令
63
+ import * as directives from './directives';
64
+
65
+ const setGlobal = app => {
66
+ app.config.globalProperties.$hasAuthority = hasAuthority;
67
+ app.config.globalProperties.$serviceApi = getServiceApi();
68
+ app.config.globalProperties.$url = getBaseURL();
69
+ };
70
+
71
+ const setGlobalDirective = app => {
72
+ Object.keys(directives).forEach(key => {
73
+ app.directive(key, (directives as { [key: string]: Directive })[key]);
74
+ });
75
+ };
76
+
77
+ const init = ({ config, lang, views, env, tableConfig }) => {
78
+ app.use(router);
79
+ setRouter(router);
80
+ setConfig(app, config);
81
+ setSystemEnv(env);
82
+ setViews(views);
83
+ setTableConfig(tableConfig);
84
+ return new Promise(resolve => {
85
+ useI18n(app, lang);
86
+ app.component('IconifyIconOffline', IconifyIconOffline);
87
+ app.component('FontIcon', FontIcon);
88
+ // app.component('uAttachment', uAttachment).component('UGrid', UGrid);
89
+ // .component('UtDivider', UtDivider)
90
+ // .component('UtModalForm2', UtModalForm2)
91
+ // app.component('FormUpload2', FormUpload2);
92
+ // .component('UtForm', UtForm)
93
+ // .component('UtContent', UtContent)
94
+ // .component('UtIconSelect', UtIconSelect)
95
+ // .component('UtCountdown', UtCountdown)
96
+ // .component('UtCalendar', UtCalendar)
97
+ // .component('UtModalGrid', UtModalGrid);
98
+ app.use(VueViewer, { defaultOptions: { zIndex: 9999 } });
99
+ setGlobal(app);
100
+ setGlobalDirective(app);
101
+ // 全局组件
102
+ setupStore(app);
103
+ injectResponsiveStorage(app, config);
104
+ const result = { app, router };
105
+ resolve(result);
106
+ });
107
+ };
108
+
109
+ export default init;
@@ -1,46 +1,53 @@
1
- /*
2
- * @Author: levi7754 levi7754@163.com
3
- * @Date: 2024-06-05 14:32:03
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-04-30 15:40:39
6
- * @FilePath: /udp-front/packages/udp-core/src/plugins/vxe-table/index.ts
7
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
- */
9
- import 'xe-utils';
10
- import { merge } from 'xe-utils';
11
- import { geti18n, transformI18n } from '../i18n/index';
12
- // import { storageLocal } from '@utogether/utils';
13
- import { VxetableRender } from '@utogether/utils';
14
- // import { VxetableRender } from './udp/render';
15
- import { getServiceApi } from '../../api';
16
-
17
- import VXETable, { VxeUI } from 'vxe-table';
18
- // import './render.tsx';
19
-
20
- // const dict = storageLocal.getItem('kLov');
21
- VxetableRender(VXETable, { serviceApi: getServiceApi(), i18n: transformI18n });
22
-
23
- // 全局默认参数
24
- const defaultConfig = {
25
- // 对组件内置的提示语进行国际化翻译
26
- // @ts-ignore
27
- i18n: (key, args) => geti18n().global.t(key, args),
28
- // 可选,对参数中的列头、校验提示..等进行自动翻译(只对支持国际化的有效)
29
- translate(key) {
30
- // 例如,只翻译 "message." 开头的键值
31
- const NAMESPACED = ['message.', 'el.'];
32
- if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
33
- return geti18n().global.t.call(geti18n().global.locale, key);
34
- }
35
- return key;
36
- }
37
- };
38
-
39
- export function setTableConfig(config = {}) {
40
- VXETable.setConfig(merge(defaultConfig, config));
41
- }
42
-
43
- export function setTheme(theme) {
44
- // 切换为暗黑主题
45
- VxeUI.setTheme(theme);
46
- }
1
+ /*
2
+ * @Author: levi7754 levi7754@163.com
3
+ * @Date: 2024-06-05 14:32:03
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-07-20 11:07:31
6
+ * @FilePath: /udp-front/packages/udp-core/src/plugins/vxe-table/index.ts
7
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
+ */
9
+ import 'xe-utils';
10
+ import { merge } from 'xe-utils';
11
+ import { geti18n, transformI18n } from '../i18n/index';
12
+ // import { storageLocal } from '@utogether/utils';
13
+ import { VxetableRender } from '@utogether/utils';
14
+ // import { VxetableRender } from './render';
15
+ import { getServiceApi } from '../../api';
16
+
17
+ import VXETable, { VxeUI } from 'vxe-table';
18
+ // import './render.tsx';
19
+
20
+ // const dict = storageLocal.getItem('kLov');
21
+ VxetableRender(VXETable, { serviceApi: getServiceApi(), i18n: transformI18n });
22
+
23
+ // 全局默认参数
24
+ const defaultConfig = {
25
+ // 对组件内置的提示语进行国际化翻译
26
+ // @ts-ignore
27
+ i18n: (key, args) => geti18n().global.t(key, args),
28
+ // 可选,对参数中的列头、校验提示..等进行自动翻译(只对支持国际化的有效)
29
+ translate(key) {
30
+ // 例如,只翻译 "message." 开头的键值
31
+ const NAMESPACED = ['message.', 'el.'];
32
+ if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
33
+ return geti18n().global.t.call(geti18n().global.locale, key);
34
+ }
35
+ return key;
36
+ }
37
+ };
38
+
39
+ export function setTableConfig(config = {}) {
40
+ VXETable.setConfig(merge(defaultConfig, config));
41
+
42
+ VxeUI.interceptor.add('event.clearEdit', {
43
+ tableInterceptorMethod(params) {
44
+ const { $event } = params;
45
+ if ($event.target.className.indexOf('vxe-table--ignore-clear') > -1) return false;
46
+ }
47
+ });
48
+ }
49
+
50
+ export function setTheme(theme) {
51
+ // 切换为暗黑主题
52
+ VxeUI.setTheme(theme);
53
+ }