@utogether/udp-core 1.0.2 → 1.0.4-beta.1

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 (87) hide show
  1. package/dist/{403-B1rIjAAu.js → 403-CH-5FVhN.js} +1 -1
  2. package/dist/{404-mBqc2y4t.js → 404-CFk6Ivq-.js} +1 -1
  3. package/dist/{500-BoI45Zdh.js → 500-DRjSNKN3.js} +1 -1
  4. package/dist/{AuthorityInfo-B08NBIIn.js → AuthorityInfo-DxNFwxdz.js} +1 -1
  5. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BLP1SaiH.js → AuthorityInfo.vue_vue_type_style_index_0_lang-BI2PKcqq.js} +1 -1
  6. package/dist/{AuthorityPanel-BeBNiwqc.js → AuthorityPanel-BzIh29KB.js} +1 -1
  7. package/dist/{AuthorityPanel.vue_vue_type_style_index_0_lang-CIYmnP9-.js → AuthorityPanel.vue_vue_type_style_index_0_lang-D3GN0Ybz.js} +32 -24
  8. package/dist/{Company-JGGyWEWH.js → Company-DGFD7_MF.js} +3 -3
  9. package/dist/{CompanyPanel-BQ_cCmDx.js → CompanyPanel-BHXndpIr.js} +1 -1
  10. package/dist/{Department-z2iO6hwM.js → Department-CFcjdf8m.js} +3 -3
  11. package/dist/{DepartmentPanel-BtQe7zwU.js → DepartmentPanel-DrBtJClY.js} +1 -1
  12. package/dist/{DesignPanel-7mhtVWas.js → DesignPanel-EAKuwOqp.js} +1 -1
  13. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-4EsHemj_.js → DesignPanel.vue_vue_type_style_index_0_lang-BOP4Q41a.js} +2 -2
  14. package/dist/{DictView-CjchV2Yk.js → DictView-CpRvxDO0.js} +10 -9
  15. package/dist/{InvOrganization-Pn1O_XP0.js → InvOrganization-DZC9aKKv.js} +1 -1
  16. package/dist/{Org-BqytV_vi.js → Org-D5heLogi.js} +1 -1
  17. package/dist/{Preview-CLpUUMay.js → Preview-DWuThn2_.js} +1 -1
  18. package/dist/{ReportDefine-Cz1KtEUF.js → ReportDefine-FeHx3B-B.js} +1 -1
  19. package/dist/{ReportDesign-BaORYud4.js → ReportDesign-Deo5AK76.js} +2 -2
  20. package/dist/{ReportQuery-CPCPXiXz.js → ReportQuery-WK5BPREv.js} +1 -1
  21. package/dist/{ReportQueryFrom-C_AcrfkJ.js → ReportQueryFrom-BcbRvwcp.js} +1 -1
  22. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-Bm67ejay.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-DEXuBXHO.js} +1 -1
  23. package/dist/{ReportTemplate-CFiNMz79.js → ReportTemplate-DAk0qIJq.js} +1 -1
  24. package/dist/{Role-B-XDoJd5.js → Role-sSVr8txF.js} +3 -3
  25. package/dist/{RoleAssign-BolW8YVs.js → RoleAssign-gg9O7P1_.js} +3 -3
  26. package/dist/{RolePanel-HilSuYns.js → RolePanel-D2M-Wc-X.js} +1 -1
  27. package/dist/{RolePanel-2kfs5tw9.js → RolePanel-DsyVPcoq.js} +1 -1
  28. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CE4gApUY.js → RolePanel.vue_vue_type_script_setup_true_lang-C4fuYoIS.js} +1 -1
  29. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DPzgfAyV.js → RolePanel.vue_vue_type_script_setup_true_lang-RR24avbF.js} +3 -3
  30. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CCTH4RkH.js → ScrollPanel.vue_vue_type_style_index_0_lang-6v5vVx-e.js} +1 -1
  31. package/dist/{Staff-BTk3whFC.js → Staff-DTDrOuE0.js} +3 -3
  32. package/dist/{StaffInfo-d3AuSzlA.js → StaffInfo-B2H_6lwQ.js} +1 -1
  33. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-eOL4VlfE.js → StaffInfo.vue_vue_type_script_setup_true_lang-BkDRBn9p.js} +1 -1
  34. package/dist/{StaffPanel-DV-D4jjz.js → StaffPanel-dpmnAD0A.js} +1 -1
  35. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-4sFq3CEo.js → StaffPanel.vue_vue_type_script_setup_true_lang-dgV9B37R.js} +47 -39
  36. package/dist/{SysUser-BnjYytws.js → SysUser-BjpQdzSo.js} +2 -2
  37. package/dist/{SysUserPanel-CBoyD-Qi.js → SysUserPanel-C5IHO7JB.js} +1 -1
  38. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-PrTlTZR-.js → SysUserPanel.vue_vue_type_script_setup_true_lang-HvJ4Hrps.js} +1 -1
  39. package/dist/{SystemMenu-kYB_ZaUt.js → SystemMenu-D7W9E8SF.js} +53 -50
  40. package/dist/{UserInfo-4dx97VBL.js → UserInfo-D_lbSbUh.js} +1 -1
  41. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-BpbC_ZDm.js → UserInfo.vue_vue_type_style_index_0_lang-NLl8VJ5I.js} +1 -1
  42. package/dist/{childView-CHPNfTEb.js → childView-B1XV2jZ7.js} +1 -1
  43. package/dist/{childView-CKA_JgVZ.js → childView-LQllG9vw.js} +1 -1
  44. package/dist/{childView.vue_vue_type_style_index_0_lang-W7bCtXeu.js → childView.vue_vue_type_style_index_0_lang-DN19uWOO.js} +31 -31
  45. package/dist/{childView.vue_vue_type_style_index_0_lang-Bym2fQRd.js → childView.vue_vue_type_style_index_0_lang-Dpo_nfX9.js} +19 -20
  46. package/dist/{code-rule-CbxuZg0-.js → code-rule-DkKKcosO.js} +1 -1
  47. package/dist/core.es.js +1 -1
  48. package/dist/{cron-task-nTOpqQYf.js → cron-task-bGVrr2Jg.js} +1 -1
  49. package/dist/{frameView-Z1tPUyCh.js → frameView-B3n2JXTj.js} +1 -1
  50. package/dist/index-DYT0k5Sg.js +8134 -0
  51. package/dist/{layoutView--MGA9zUB.js → layoutView-bh22tftc.js} +144 -145
  52. package/dist/{log-in-CSYJDA6m.js → log-in-Dk_xyZ_l.js} +1 -1
  53. package/dist/{log-out-DiwGCg7p.js → log-out-CERhlqtr.js} +1 -1
  54. package/dist/{login-C6Y0ajDp.js → login-C5EJWWLi.js} +124 -134
  55. package/dist/{login-log-C0V-_l3F.js → login-log-DJBGJVV0.js} +4 -4
  56. package/dist/{lov-view-Cmv7wZZ9.js → lov-view-BNGHpq-d.js} +2 -2
  57. package/dist/{menuInfo-UeutJpOa.js → menuInfo-2DBTH6Vf.js} +1 -1
  58. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CWX4Mu67.js → menuInfo.vue_vue_type_style_index_0_lang-KtLS__XM.js} +37 -35
  59. package/dist/{pda-app-B6w99SJo.js → pda-app-BzmHIT9A.js} +1 -1
  60. package/dist/{resource-BybJvUv0.js → resource-D6UY8vN8.js} +1 -1
  61. package/dist/{su-welcome-C1bmxHoY.js → su-welcome-okexK2W2.js} +20 -20
  62. package/dist/{sys-config-BnmIDnCj.js → sys-config-9F_C1LzR.js} +1 -1
  63. package/dist/udp-core.css +1 -1
  64. package/package.json +1 -1
  65. package/src/App.vue +73 -65
  66. package/src/components/udp/form-upload/form-upload.vue +492 -0
  67. package/src/components/udp/index.ts +2 -1
  68. package/src/layout/components/lay-content/index.vue +136 -143
  69. package/src/layout/components/lay-sidebar/sidebar-logo.vue +1 -1
  70. package/src/layout/layoutView.vue +7 -6
  71. package/src/main.ts +2 -2
  72. package/src/plugins/i18n/zh.ts +1 -0
  73. package/src/plugins/vxe-table/index.ts +116 -116
  74. package/src/plugins/vxe-table/render.tsx +968 -945
  75. package/src/style/vxetable.scss +356 -348
  76. package/src/utils/dataFormat/index.ts +17 -18
  77. package/src/views/organization/staff/StaffPanel.vue +12 -3
  78. package/src/views/system/menu/AuthorityPanel.vue +142 -140
  79. package/src/views/system/menu/SystemMenu.vue +194 -185
  80. package/src/views/system/menu/menuInfo.vue +384 -384
  81. package/src/views/udev/dict/DictView.vue +2 -2
  82. package/src/views/udev/dict/childView.vue +6 -6
  83. package/src/views/udev/lov/childView.vue +174 -174
  84. package/src/views/uhome/components/menu-favorite.vue +3 -2
  85. package/src/views/ulogin/login.vue +34 -23
  86. package/src/views/upms/user/login-log.vue +5 -5
  87. package/dist/index-C3q8HoJM.js +0 -4650
@@ -1,143 +1,136 @@
1
- <!--
2
- * @Author: wei.li
3
- * @Date: 2021-12-23 17:33:20
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-04-05 10:43:53
6
- * @Description: 主页面
7
- -->
8
- <script setup lang="ts">
9
- import { h, computed, Transition, defineComponent } from 'vue';
10
- import { useGlobal } from '@utogether/utils';
11
- import { useI18n } from 'vue-i18n';
12
- import { useTags } from '../../hooks/useTag';
13
- import backTop from '../../../assets/svg/back_top.svg?component';
14
- import { usePermissionStoreHook } from '../../../store/modules/permission';
15
-
16
- const props = defineProps({
17
- fixedHeader: Boolean
18
- });
19
-
20
- const { showModel } = useTags();
21
- const { t } = useI18n();
22
- const { $storage, $config } = useGlobal();
23
-
24
- const keepAlive = computed(() => {
25
- return $config?.KeepAlive;
26
- });
27
-
28
- const transitions = computed(() => {
29
- return route => {
30
- return route.meta.transition;
31
- };
32
- });
33
-
34
- const hideTabs = computed(() => {
35
- return $storage?.configure.hideTabs;
36
- });
37
- const layout = computed(() => {
38
- return $storage?.layout.layout === 'vertical';
39
- });
40
-
41
- const getSectionStyle = computed(() => {
42
- // 在iframe中默认就是审批
43
- return window.top === window.self
44
- ? [
45
- hideTabs.value && layout ? 'padding-top: 48px;' : '',
46
- !hideTabs.value && layout
47
- ? showModel.value == 'chrome'
48
- ? 'padding-top: 85px;'
49
- : 'padding-top: 81px;'
50
- : '',
51
- hideTabs.value && !layout.value ? 'padding-top: 48px' : '',
52
- !hideTabs.value && !layout.value
53
- ? showModel.value == 'chrome'
54
- ? 'padding-top: 85px;'
55
- : 'padding-top: 81px;'
56
- : '',
57
- props.fixedHeader ? '' : 'padding-top: 0;'
58
- ]
59
- : 'padding-top: 0';
60
- });
61
-
62
- const transitionMain = defineComponent({
63
- props: {
64
- route: {
65
- type: undefined,
66
- required: true
67
- }
68
- },
69
- render() {
70
- const transitionName = transitions.value(this.route)?.name || 'fade-transform';
71
- const enterTransition = transitions.value(this.route)?.enterTransition;
72
- const leaveTransition = transitions.value(this.route)?.leaveTransition;
73
- return h(
74
- Transition,
75
- {
76
- name: enterTransition ? 'pure-classes-transition' : transitionName,
77
- enterActiveClass: enterTransition ? `animate__animated ${enterTransition}` : undefined,
78
- leaveActiveClass: leaveTransition ? `animate__animated ${leaveTransition}` : undefined,
79
- mode: 'out-in',
80
- appear: true
81
- },
82
- {
83
- default: () => [this.$slots.default()]
84
- }
85
- );
86
- }
87
- });
88
- </script>
89
-
90
- <template>
91
- <section
92
- :class="[props.fixedHeader ? 'app-main' : 'app-main-nofixed-header']"
93
- :style="getSectionStyle"
94
- >
95
- <router-view>
96
- <template #default="{ Component, route }">
97
- <el-scrollbar v-if="props.fixedHeader">
98
- <template #default>
99
- <div class="h-full">
100
- <el-backtop :title="t('message.udp.backtop')" target=".app-main .el-scrollbar__wrap">
101
- <backTop />
102
- </el-backtop>
103
- <transitionMain :route="route">
104
- <keep-alive v-if="keepAlive" :include="usePermissionStoreHook().cachePageList">
105
- <component :is="Component" :key="route.fullPath" class="main-content" />
106
- </keep-alive>
107
- <component :is="Component" v-else :key="route.fullPath" class="main-content" />
108
- </transitionMain>
109
- </div>
110
- </template>
111
- </el-scrollbar>
112
- <div v-else>
113
- <transitionMain :route="route">
114
- <keep-alive v-if="keepAlive" :include="usePermissionStoreHook().cachePageList">
115
- <component :is="Component" :key="route.fullPath" class="main-content" />
116
- </keep-alive>
117
- <component :is="Component" v-else :key="route.fullPath" class="main-content" />
118
- </transitionMain>
119
- </div>
120
- </template>
121
- </router-view>
122
- </section>
123
- </template>
124
-
125
- <style scoped>
126
- .app-main {
127
- position: relative;
128
- width: 100%;
129
- height: 100vh;
130
- overflow-x: hidden;
131
- }
132
-
133
- .app-main-nofixed-header {
134
- position: relative;
135
- width: 100%;
136
- min-height: 100vh;
137
- }
138
-
139
- .main-content {
140
- /* padding: 6px; */
141
- height: 100%;
142
- }
143
- </style>
1
+ <!--
2
+ * @Author: wei.li
3
+ * @Date: 2021-12-23 17:33:20
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-12-18 09:35:26
6
+ * @Description: 主页面
7
+ -->
8
+ <script setup lang="ts">
9
+ import { h, computed, Transition, defineComponent } from 'vue';
10
+ import { useGlobal } from '@utogether/utils';
11
+ import { useI18n } from 'vue-i18n';
12
+ import { useTags } from '../../hooks/useTag';
13
+ import backTop from '../../../assets/svg/back_top.svg?component';
14
+ import { usePermissionStoreHook } from '../../../store/modules/permission';
15
+
16
+ const props = defineProps({
17
+ fixedHeader: Boolean
18
+ });
19
+
20
+ const { showModel } = useTags();
21
+ const { t } = useI18n();
22
+ const { $storage, $config } = useGlobal();
23
+
24
+ const keepAlive = computed(() => {
25
+ return $config?.KeepAlive;
26
+ });
27
+
28
+ const transitions = computed(() => {
29
+ return route => {
30
+ return route.meta.transition;
31
+ };
32
+ });
33
+
34
+ const hideTabs = computed(() => {
35
+ return $storage?.configure.hideTabs;
36
+ });
37
+ const layout = computed(() => {
38
+ return $storage?.layout.layout === 'vertical';
39
+ });
40
+
41
+ const getSectionStyle = computed(() => {
42
+ // 在iframe中默认就是审批
43
+ return window.top === window.self
44
+ ? [
45
+ hideTabs.value && layout ? 'padding-top: 48px;' : '',
46
+ !hideTabs.value && layout ? (showModel.value == 'chrome' ? 'padding-top: 85px;' : 'padding-top: 81px;') : '',
47
+ hideTabs.value && !layout.value ? 'padding-top: 48px' : '',
48
+ !hideTabs.value && !layout.value
49
+ ? showModel.value == 'chrome'
50
+ ? 'padding-top: 85px;'
51
+ : 'padding-top: 81px;'
52
+ : '',
53
+ props.fixedHeader ? '' : 'padding-top: 0;'
54
+ ]
55
+ : 'padding-top: 0';
56
+ });
57
+
58
+ const transitionMain = defineComponent({
59
+ props: {
60
+ route: {
61
+ type: undefined,
62
+ required: true
63
+ }
64
+ },
65
+ render() {
66
+ const transitionName = transitions.value(this.route)?.name || 'fade-transform';
67
+ const enterTransition = transitions.value(this.route)?.enterTransition;
68
+ const leaveTransition = transitions.value(this.route)?.leaveTransition;
69
+ return h(
70
+ Transition,
71
+ {
72
+ name: enterTransition ? 'pure-classes-transition' : transitionName,
73
+ enterActiveClass: enterTransition ? `animate__animated ${enterTransition}` : undefined,
74
+ leaveActiveClass: leaveTransition ? `animate__animated ${leaveTransition}` : undefined,
75
+ mode: 'out-in',
76
+ appear: true
77
+ },
78
+ {
79
+ default: () => [this.$slots.default()]
80
+ }
81
+ );
82
+ }
83
+ });
84
+ </script>
85
+
86
+ <template>
87
+ <section :class="[props.fixedHeader ? 'app-main' : 'app-main-nofixed-header']" :style="getSectionStyle">
88
+ <router-view>
89
+ <template #default="{ Component, route }">
90
+ <el-scrollbar v-if="props.fixedHeader">
91
+ <template #default>
92
+ <div class="h-full">
93
+ <el-backtop :title="t('message.udp.backtop')" style="z-index: 100" target=".app-main .el-scrollbar__wrap">
94
+ <backTop />
95
+ </el-backtop>
96
+ <transitionMain :route="route">
97
+ <keep-alive v-if="keepAlive" :include="usePermissionStoreHook().cachePageList">
98
+ <component :is="Component" :key="route.fullPath" class="main-content" />
99
+ </keep-alive>
100
+ <component :is="Component" v-else :key="route.fullPath" class="main-content" />
101
+ </transitionMain>
102
+ </div>
103
+ </template>
104
+ </el-scrollbar>
105
+ <div v-else>
106
+ <transitionMain :route="route">
107
+ <keep-alive v-if="keepAlive" :include="usePermissionStoreHook().cachePageList">
108
+ <component :is="Component" :key="route.fullPath" class="main-content" />
109
+ </keep-alive>
110
+ <component :is="Component" v-else :key="route.fullPath" class="main-content" />
111
+ </transitionMain>
112
+ </div>
113
+ </template>
114
+ </router-view>
115
+ </section>
116
+ </template>
117
+
118
+ <style scoped>
119
+ .app-main {
120
+ position: relative;
121
+ width: 100%;
122
+ height: 100vh;
123
+ overflow-x: hidden;
124
+ }
125
+
126
+ .app-main-nofixed-header {
127
+ position: relative;
128
+ width: 100%;
129
+ min-height: 100vh;
130
+ }
131
+
132
+ .main-content {
133
+ /* padding: 6px; */
134
+ height: 100%;
135
+ }
136
+ </style>
@@ -19,7 +19,7 @@ const props = defineProps({
19
19
  const sysConfig = storageLocal.getItem(kSYSCONFIG) || {};
20
20
 
21
21
  const title = sysConfig['title'];
22
- const showTitle = sysConfig['showTitle'];
22
+ const showTitle = ref(sysConfig['showTitle']);
23
23
  const logo = ref(sysConfig['logo'] || utogether);
24
24
  </script>
25
25
 
@@ -132,8 +132,7 @@ const layoutHeader = defineComponent({
132
132
  },
133
133
  {
134
134
  default: () => [
135
- !settingHook.hiddenSideBar &&
136
- (layout.value.includes('vertical') || layout.value.includes('mix'))
135
+ !settingHook.hiddenSideBar && (layout.value.includes('vertical') || layout.value.includes('mix'))
137
136
  ? h(navbar)
138
137
  : null,
139
138
  !settingHook.hiddenSideBar && layout.value.includes('horizontal') ? h(Horizontal) : null,
@@ -153,9 +152,7 @@ const layoutHeader = defineComponent({
153
152
  @click="useAppStoreHook().toggleSideBar()"
154
153
  />
155
154
  <Vertical
156
- v-show="
157
- inIframe && !settingHook.hiddenSideBar && (layout.includes('vertical') || layout.includes('mix'))
158
- "
155
+ v-show="inIframe && !settingHook.hiddenSideBar && (layout.includes('vertical') || layout.includes('mix'))"
159
156
  />
160
157
  <div :class="['main-container', settingHook.hiddenSideBar ? 'main-hidden' : '']">
161
158
  <div v-if="set.fixedHeader">
@@ -166,7 +163,11 @@ const layoutHeader = defineComponent({
166
163
  <el-scrollbar v-else>
167
164
  <template #default>
168
165
  <div class="h-full">
169
- <el-backtop :title="t('message.udp.backtop')" target=".main-container .el-scrollbar__wrap">
166
+ <el-backtop
167
+ :title="t('message.udp.backtop')"
168
+ style="z-index: 100"
169
+ target=".main-container .el-scrollbar__wrap"
170
+ >
170
171
  <backTop />
171
172
  </el-backtop>
172
173
  <layout-header v-if="inIframe" />
package/src/main.ts CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  // utLov2,
37
37
  // UtDivider,
38
38
  // UtModalForm2
39
- // FormUpload2,
39
+ FormUpload2,
40
40
  // UtForm2,
41
41
  UtGrid2
42
42
  // UtContent2
@@ -95,7 +95,7 @@ const init = ({ router, config, lang, views, env, tableConfig }) => {
95
95
  // app.component('UtForm2', UtForm2);
96
96
  // app.component('UtModalGrid2', UtModalGrid2);
97
97
  // .component('UtIconSelect', UtIconSelect)
98
- // app.component('FormUpload2', FormUpload2);
98
+ app.component('FormUpload2', FormUpload2);
99
99
  // .component('UtCalendar', UtCalendar)
100
100
  // app.component('UtContent2', UtContent2);
101
101
  // app.component('UtStampBadge2', UtStampBadge2);
@@ -70,6 +70,7 @@ export default {
70
70
  startValue: '开始值',
71
71
  currentValue: '当前值',
72
72
  haveBeenUsed: '使用中',
73
+ description: '描述',
73
74
 
74
75
  unitName: '单位名称',
75
76
  unitCode: '单位编码',
@@ -1,116 +1,116 @@
1
- /*
2
- * @Author: levi7754 levi7754@163.com
3
- * @Date: 2024-06-05 14:32:03
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-11-04 13:58:45
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, toDateString, getWhatDay } 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
- setCommands();
23
-
24
- // 全局默认参数
25
- const defaultConfig = {
26
- // 对组件内置的提示语进行国际化翻译
27
- // @ts-ignore
28
- i18n: (key, args) => geti18n().global.t(key, args),
29
- // 可选,对参数中的列头、校验提示..等进行自动翻译(只对支持国际化的有效)
30
- translate(key) {
31
- // 例如,只翻译 "message." 开头的键值
32
- const NAMESPACED = ['message.', 'el.'];
33
- if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
34
- return geti18n().global.t.call(geti18n().global.locale, key);
35
- }
36
- return key;
37
- }
38
- };
39
-
40
- export function setTableConfig(config = {}) {
41
- VXETable.setConfig(merge(defaultConfig, config));
42
-
43
- VxeUI.interceptor.add('event.clearEdit', {
44
- tableInterceptorMethod(params) {
45
- const { $event } = params;
46
- if ($event.target.className.indexOf('vxe-table--ignore-clear') > -1) return false;
47
- }
48
- });
49
- }
50
-
51
- export function setTheme(theme) {
52
- // 切换为暗黑主题
53
- VxeUI.setTheme(theme);
54
- }
55
-
56
- function setCommands() {
57
- // 定义选中日期今天指令
58
- VxeUI.commands.add('utTodyay', {
59
- dateRangePickerCommandMethod({ $dateRangePicker }) {
60
- const startDate = toDateString(new Date(), 'yyyy-MM-dd 00:00:00');
61
- const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
62
- $dateRangePicker.setModelValue(startDate, endDate);
63
- }
64
- });
65
- // 定义选中日期昨天指令
66
- VxeUI.commands.add('utYesterDay', {
67
- dateRangePickerCommandMethod({ $dateRangePicker }) {
68
- const startDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 00:00:00');
69
- const endDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 23:59:59');
70
- $dateRangePicker.setModelValue(startDate, endDate);
71
- }
72
- });
73
- // 定义选中日期最近一周指令
74
- VxeUI.commands.add('utRecentWeek', {
75
- dateRangePickerCommandMethod({ $dateRangePicker }) {
76
- const startDate = toDateString(getWhatDay(new Date(), -7), 'yyyy-MM-dd 00:00:00');
77
- const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
78
- $dateRangePicker.setModelValue(startDate, endDate);
79
- }
80
- });
81
-
82
- // 定义选中日期最近一个月指令
83
- VxeUI.commands.add('utRecentMonth', {
84
- dateRangePickerCommandMethod({ $dateRangePicker }) {
85
- const startDate = toDateString(getWhatDay(new Date(), -30), 'yyyy-MM-dd 00:00:00');
86
- const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
87
- $dateRangePicker.setModelValue(startDate, endDate);
88
- }
89
- });
90
-
91
- // 定义选中日期最近三个月指令
92
- VxeUI.commands.add('utRecentThreeMonth', {
93
- dateRangePickerCommandMethod({ $dateRangePicker }) {
94
- const startDate = toDateString(getWhatDay(new Date(), -90), 'yyyy-MM-dd 00:00:00');
95
- const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
96
- $dateRangePicker.setModelValue(startDate, endDate);
97
- }
98
- });
99
-
100
- // 定义选中日期最近半年指令
101
- VxeUI.commands.add('utRecentHalfYear', {
102
- dateRangePickerCommandMethod({ $dateRangePicker }) {
103
- const startDate = toDateString(getWhatDay(new Date(), -180), 'yyyy-MM-dd 00:00:00');
104
- const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
105
- $dateRangePicker.setModelValue(startDate, endDate);
106
- }
107
- });
108
- // 定义选中日期最近半年指令
109
- VxeUI.commands.add('utRecentYear', {
110
- dateRangePickerCommandMethod({ $dateRangePicker }) {
111
- const startDate = toDateString(getWhatDay(new Date(), -365), 'yyyy-MM-dd 00:00:00');
112
- const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
113
- $dateRangePicker.setModelValue(startDate, endDate);
114
- }
115
- });
116
- }
1
+ /*
2
+ * @Author: levi7754 levi7754@163.com
3
+ * @Date: 2024-06-05 14:32:03
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-12-09 08:57:02
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, toDateString, getWhatDay } 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
+ setCommands();
23
+
24
+ // 全局默认参数
25
+ const defaultConfig = {
26
+ // 对组件内置的提示语进行国际化翻译
27
+ // @ts-ignore
28
+ i18n: (key, args) => geti18n().global.t(key, args),
29
+ // 可选,对参数中的列头、校验提示..等进行自动翻译(只对支持国际化的有效)
30
+ translate(key) {
31
+ // 例如,只翻译 "message." 开头的键值
32
+ const NAMESPACED = ['message.', 'el.'];
33
+ if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
34
+ return geti18n().global.t.call(geti18n().global.locale, key);
35
+ }
36
+ return key;
37
+ }
38
+ };
39
+
40
+ export function setTableConfig(config = {}) {
41
+ VXETable.setConfig(merge(defaultConfig, config));
42
+
43
+ VxeUI.interceptor.add('event.clearEdit', {
44
+ tableInterceptorMethod(params) {
45
+ const { $event } = params;
46
+ if ($event.target.className.indexOf('vxe-table--ignore-clear') > -1) return false;
47
+ }
48
+ });
49
+ }
50
+
51
+ export function setTheme(theme) {
52
+ // 切换为暗黑主题
53
+ VxeUI.setTheme(theme);
54
+ }
55
+
56
+ function setCommands() {
57
+ // 定义选中日期今天指令
58
+ VxeUI.commands.add('utTodyay', {
59
+ dateRangePickerCommandMethod({ $dateRangePicker }) {
60
+ const startDate = toDateString(new Date(), 'yyyy-MM-dd 00:00:00');
61
+ const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
62
+ $dateRangePicker.setModelValue(startDate, endDate);
63
+ }
64
+ });
65
+ // 定义选中日期昨天指令
66
+ VxeUI.commands.add('utYesterDay', {
67
+ dateRangePickerCommandMethod({ $dateRangePicker }) {
68
+ const startDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 00:00:00');
69
+ const endDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 23:59:59');
70
+ $dateRangePicker.setModelValue(startDate, endDate);
71
+ }
72
+ });
73
+ // 定义选中日期最近一周指令
74
+ VxeUI.commands.add('utRecentWeek', {
75
+ dateRangePickerCommandMethod({ $dateRangePicker }) {
76
+ const startDate = toDateString(getWhatDay(new Date(), -7), 'yyyy-MM-dd 00:00:00');
77
+ const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
78
+ $dateRangePicker.setModelValue(startDate, endDate);
79
+ }
80
+ });
81
+
82
+ // 定义选中日期最近一个月指令
83
+ VxeUI.commands.add('utRecentMonth', {
84
+ dateRangePickerCommandMethod({ $dateRangePicker }) {
85
+ const startDate = toDateString(getWhatDay(new Date(), -30), 'yyyy-MM-dd 00:00:00');
86
+ const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
87
+ $dateRangePicker.setModelValue(startDate, endDate);
88
+ }
89
+ });
90
+
91
+ // 定义选中日期最近三个月指令
92
+ VxeUI.commands.add('utRecentThreeMonth', {
93
+ dateRangePickerCommandMethod({ $dateRangePicker }) {
94
+ const startDate = toDateString(getWhatDay(new Date(), -90), 'yyyy-MM-dd 00:00:00');
95
+ const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
96
+ $dateRangePicker.setModelValue(startDate, endDate);
97
+ }
98
+ });
99
+
100
+ // 定义选中日期最近半年指令
101
+ VxeUI.commands.add('utRecentHalfYear', {
102
+ dateRangePickerCommandMethod({ $dateRangePicker }) {
103
+ const startDate = toDateString(getWhatDay(new Date(), -180), 'yyyy-MM-dd 00:00:00');
104
+ const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
105
+ $dateRangePicker.setModelValue(startDate, endDate);
106
+ }
107
+ });
108
+ // 定义选中日期最近半年指令
109
+ VxeUI.commands.add('utRecentYear', {
110
+ dateRangePickerCommandMethod({ $dateRangePicker }) {
111
+ const startDate = toDateString(getWhatDay(new Date(), -365), 'yyyy-MM-dd 00:00:00');
112
+ const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
113
+ $dateRangePicker.setModelValue(startDate, endDate);
114
+ }
115
+ });
116
+ }