@utogether/udp-core 1.0.1-beta.17 → 1.0.1-beta.18
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/{403-C3cfjZIT.js → 403-B8xAGW0x.js} +1 -1
- package/dist/{404-Bg3j7QIo.js → 404-BtgajMpP.js} +1 -1
- package/dist/{500-CMT7Zyy7.js → 500-DFWWZylZ.js} +1 -1
- package/dist/{AuthorityInfo-B1mvqs4x.js → AuthorityInfo-BxWSZs7n.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-DwoW7QWO.js → AuthorityInfo.vue_vue_type_style_index_0_lang-XIiFdjxN.js} +1 -1
- package/dist/{Company-qTguidK8.js → Company-BbUJtuvr.js} +3 -3
- package/dist/{CompanyPanel-BBC-o-k3.js → CompanyPanel-KOOFrGjk.js} +1 -1
- package/dist/{Department-C3mKZOnK.js → Department-BimSgBm2.js} +3 -3
- package/dist/{DepartmentPanel-CNdpOHBT.js → DepartmentPanel-DYXPUCDs.js} +1 -1
- package/dist/{DesignPanel-D9jrRCoG.js → DesignPanel-CHZ36J4q.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-A-Aj1Hl0.js → DesignPanel.vue_vue_type_style_index_0_lang-ZbNixuuY.js} +2 -2
- package/dist/{DictView-CgdVkSiP.js → DictView-7RQYVj4H.js} +1 -1
- package/dist/{InvOrganization-RE7s3vBq.js → InvOrganization-esq9FI1K.js} +1 -1
- package/dist/{Org-wXDGvTrS.js → Org-BGswGV9g.js} +1 -1
- package/dist/{Preview-Pvt1__BV.js → Preview-DP0pD6Kf.js} +1 -1
- package/dist/{ReportDefine-xEQsgFyv.js → ReportDefine-1rjKlbK-.js} +1 -1
- package/dist/{ReportDesign-jOSuEFH9.js → ReportDesign-BIUj35Kh.js} +2 -2
- package/dist/{ReportQuery-DxEmmGiN.js → ReportQuery-CWevStRg.js} +1 -1
- package/dist/{ReportQueryFrom-CFlxfS5M.js → ReportQueryFrom-vlOF5_gc.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-iHpiYz8f.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-BGyeoYxo.js} +1 -1
- package/dist/{ReportTemplate-Dtz3aet7.js → ReportTemplate-BPURQOFZ.js} +1 -1
- package/dist/{Role-B_NsHIyE.js → Role-D8xJ3rai.js} +3 -3
- package/dist/{RoleAssign-C9wm4zq4.js → RoleAssign-CE5FeHLd.js} +3 -3
- package/dist/{RolePanel-DWM9mfNs.js → RolePanel-B6wskQVB.js} +1 -1
- package/dist/{RolePanel-BlHidBR0.js → RolePanel-CqHsGjrK.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DVQ9aqb1.js → RolePanel.vue_vue_type_script_setup_true_lang-Bjoq-nCm.js} +3 -3
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Cn4RRzXm.js → RolePanel.vue_vue_type_script_setup_true_lang-Dv5IVELj.js} +1 -1
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CCm-_i8O.js → ScrollPanel.vue_vue_type_style_index_0_lang-Bp8Y_5A2.js} +1 -1
- package/dist/{Staff-BfDc61QS.js → Staff-DuYrik71.js} +3 -3
- package/dist/{StaffInfo-BaJFo4mg.js → StaffInfo-CZiak-1b.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-Bwj4x1wu.js → StaffInfo.vue_vue_type_script_setup_true_lang-LCuqxUh8.js} +1 -1
- package/dist/{StaffPanel-B6I2ZS6A.js → StaffPanel-DI6MBAJH.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-vbyS4w3V.js → StaffPanel.vue_vue_type_script_setup_true_lang-DxJhnVpd.js} +2 -2
- package/dist/{SysUser-B_r9LYc5.js → SysUser-DoNj2tIV.js} +2 -2
- package/dist/{SysUserPanel-C4ajcHPV.js → SysUserPanel-CvfyRxel.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-8Q0VvC9B.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BoghL7F3.js} +1 -1
- package/dist/{SystemMenu-CyPG23uP.js → SystemMenu-Cr3vUEQU.js} +2 -2
- package/dist/{UserInfo-BkoGt4ib.js → UserInfo-6c8UDIVO.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-DrzF1YYG.js → UserInfo.vue_vue_type_style_index_0_lang-DstUSeNQ.js} +1 -1
- package/dist/{childView-9vEO8ymO.js → childView-BlmHw5jv.js} +1 -1
- package/dist/{childView-Dh0NyiQe.js → childView-C050pf1v.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CMOjfXBX.js → childView.vue_vue_type_style_index_0_lang-BxLT1Dz0.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-BOeoZuAK.js → childView.vue_vue_type_style_index_0_lang-D0nlTIP-.js} +1 -1
- package/dist/{code-rule-C7jI_1gJ.js → code-rule-Br1Mh3_M.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-Dg9DJXvv.js → cron-task-DhuIk5pP.js} +1 -1
- package/dist/{frameView-CeR-_hjB.js → frameView-hJoSI0Ai.js} +1 -1
- package/dist/index-1dgWFXT2.js +5436 -0
- package/dist/{layoutView-wsLHrEeX.js → layoutView-DU-TVfOp.js} +2 -2
- package/dist/{login-CluzzdqH.js → login-CzJBV0x8.js} +1 -1
- package/dist/{lov-view-BvQCvwbW.js → lov-view-BxaHaVKE.js} +2 -2
- package/dist/{menuInfo-B8RLelIC.js → menuInfo-Dp7nAbgM.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-DvkapEZr.js → menuInfo.vue_vue_type_style_index_0_lang-Ch4NbiCL.js} +1 -1
- package/dist/{pda-app-D3LNmD9a.js → pda-app-BmxY3H7y.js} +1 -1
- package/dist/{resource-D8JA_03-.js → resource-D2dCI_x9.js} +1 -1
- package/dist/{su-welcome-BjxeEKSo.js → su-welcome-BKGU5HUf.js} +1 -1
- package/dist/{sys-config-sbeLk9bP.js → sys-config-s8DnZMOd.js} +1 -1
- package/dist/udp-core.css +1 -1
- package/package.json +1 -1
- package/src/components/udp/grid/index.vue +13 -2
- package/src/components/udp/utils.ts +7 -5
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +93 -92
- package/src/main.ts +18 -18
- package/src/plugins/vxe-table/index.ts +116 -116
- package/src/plugins/vxe-table/render.tsx +945 -956
- package/src/style/vxetable.scss +338 -331
- package/dist/index-Bb7gIEvu.js +0 -2864
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-11-17 16:33:37
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-10-
|
|
5
|
+
* @LastEditTime: 2025-10-29 17:55:12
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<template>
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
@cell-click="cellClick"
|
|
18
18
|
@cell-dblclick="cellDbclick"
|
|
19
19
|
@edit-activated="editEctivated"
|
|
20
|
+
@form-reset="onReset"
|
|
20
21
|
/>
|
|
21
22
|
<!-- <SearchScheme
|
|
22
23
|
v-if="showModal && props.url"
|
|
@@ -174,7 +175,7 @@ const data = reactive<VxeGridProps>({
|
|
|
174
175
|
// 接收 Promise
|
|
175
176
|
ajax: {
|
|
176
177
|
queryAll: ({ form }) => queryAll(props, serviceApi, form),
|
|
177
|
-
query: ({ page, form }) => query(props, form, page, serviceApi, $mode),
|
|
178
|
+
query: ({ page, form, code }) => query(props, form, page, serviceApi, code, $mode),
|
|
178
179
|
delete: ({ body: { removeRecords } }) => del(serviceApi, removeRecords, props),
|
|
179
180
|
save: ({ body }) => Promise.all(save(serviceApi, body, props)),
|
|
180
181
|
querySuccess: ({ response }) => callback('querySuccess', response),
|
|
@@ -316,6 +317,16 @@ const callback = (cb, response) => {
|
|
|
316
317
|
attrs?.callback && attrs?.callback[cb] && attrs?.callback[cb](response);
|
|
317
318
|
};
|
|
318
319
|
|
|
320
|
+
const onReset = ({ data }) => {
|
|
321
|
+
console.log(data);
|
|
322
|
+
const items = props.items.filter(f => f.itemRender?.props?.multiple);
|
|
323
|
+
console.log(items);
|
|
324
|
+
items.forEach(item => {
|
|
325
|
+
data[`_${item.field}`] = [];
|
|
326
|
+
});
|
|
327
|
+
refreshData();
|
|
328
|
+
};
|
|
329
|
+
|
|
319
330
|
let sortable2: any;
|
|
320
331
|
const columnDrop = () => {
|
|
321
332
|
const $grid = xgrid.value;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2022-06-23 17:29:11
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-10-18
|
|
5
|
+
* @LastEditTime: 2025-10-29 18:04:53
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
// @ts-nocheck
|
|
@@ -70,7 +70,7 @@ export const queryAll = (props, http, form) => {
|
|
|
70
70
|
* @param isDoc doc文档
|
|
71
71
|
* @returns Promise
|
|
72
72
|
*/
|
|
73
|
-
export const query = (props, form, page, http, isDoc) => {
|
|
73
|
+
export const query = (props, form, page, http, code, isDoc) => {
|
|
74
74
|
if (isDoc) return getDocData();
|
|
75
75
|
for (const key in form) {
|
|
76
76
|
if (form[key] && isString(form[key])) {
|
|
@@ -80,7 +80,8 @@ export const query = (props, form, page, http, isDoc) => {
|
|
|
80
80
|
const params = { pageNum: page.currentPage, pageSize: page.pageSize };
|
|
81
81
|
const commonParam = getCookieParam();
|
|
82
82
|
Object.assign(params, commonParam, props.defaultParams || {}, form);
|
|
83
|
-
|
|
83
|
+
|
|
84
|
+
let query = formatMultipleParams(params, props.items, form);
|
|
84
85
|
query = formatDateRange(query, props.items);
|
|
85
86
|
const { url } = props;
|
|
86
87
|
if (!url) return null;
|
|
@@ -140,12 +141,13 @@ export const save = (http, body, props) => {
|
|
|
140
141
|
*/
|
|
141
142
|
const formatMultipleParams = (listQuery: any, items) => {
|
|
142
143
|
const multipleItems = items.filter(f => f.itemRender?.props?.multiple || f.multiple);
|
|
144
|
+
debugger;
|
|
143
145
|
if (isEmpty(multipleItems)) return listQuery;
|
|
144
146
|
const query = clone(listQuery, true);
|
|
145
147
|
multipleItems.forEach((element: any) => {
|
|
146
148
|
if (element.itemRender.name === '#select') {
|
|
147
|
-
const data = query[`_${element.field}`] || query[`${element.field}`];
|
|
148
|
-
query[element.field] = !isString(data) ? data?.join(',') : data;
|
|
149
|
+
// const data = query[`_${element.field}`] || query[`${element.field}`];
|
|
150
|
+
// query[element.field] = !isString(data) ? data?.join(',') : data;
|
|
149
151
|
delete query[`_${element.field}`];
|
|
150
152
|
}
|
|
151
153
|
});
|
|
@@ -1,92 +1,93 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-17 16:02:30
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-04-17 17:15:15
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script setup lang="ts">
|
|
9
|
-
import { ref } from 'vue';
|
|
10
|
-
import { storageLocal } from '@utogether/utils';
|
|
11
|
-
import { kSYSCONFIG } from '../../../contant';
|
|
12
|
-
import utogether from '../../../assets/images/utogether.png';
|
|
13
|
-
|
|
14
|
-
const props = defineProps({
|
|
15
|
-
collapse: Boolean
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const sysConfig = storageLocal.getItem(kSYSCONFIG) || {};
|
|
19
|
-
|
|
20
|
-
const title = sysConfig['title'];
|
|
21
|
-
const logo = ref(sysConfig['logo'] || utogether);
|
|
22
|
-
// console.log(logo);
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<div class="sidebar-logo-container" :class="{ collapses: props.collapse }">
|
|
27
|
-
<transition name="sidebarLogoFade">
|
|
28
|
-
<router-link v-if="props.collapse" key="props.collapse" :title="title" class="sidebar-logo-link" to="/">
|
|
29
|
-
<img :src="logo" class="ut-collapse-img ut-sidebar-logo" />
|
|
30
|
-
</router-link>
|
|
31
|
-
<router-link v-else key="expand" :title="title" class="sidebar-logo-link" to="/">
|
|
32
|
-
<img :src="logo" class="ut-sidebar-logo h-10" />
|
|
33
|
-
<span class="sidebar-title">{{ title }}</span>
|
|
34
|
-
</router-link>
|
|
35
|
-
</transition>
|
|
36
|
-
</div>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<style lang="scss" scoped>
|
|
40
|
-
.sidebar-logo-container {
|
|
41
|
-
position: relative;
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 48px;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
text-align: center;
|
|
46
|
-
background-color: var(--udp-theme-sidebar-logo);
|
|
47
|
-
|
|
48
|
-
.sidebar-logo-link {
|
|
49
|
-
// margin-top: 5px;
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
height: 100%;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
text-overflow: ellipsis;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
|
|
57
|
-
.ut-sidebar-logo {
|
|
58
|
-
height: 100%;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
margin-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
font-
|
|
74
|
-
font-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-17 16:02:30
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-04-17 17:15:15
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { ref } from 'vue';
|
|
10
|
+
import { storageLocal } from '@utogether/utils';
|
|
11
|
+
import { kSYSCONFIG } from '../../../contant';
|
|
12
|
+
import utogether from '../../../assets/images/utogether.png';
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
collapse: Boolean
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const sysConfig = storageLocal.getItem(kSYSCONFIG) || {};
|
|
19
|
+
|
|
20
|
+
const title = sysConfig['title'];
|
|
21
|
+
const logo = ref(sysConfig['logo'] || utogether);
|
|
22
|
+
// console.log(logo);
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="sidebar-logo-container" :class="{ collapses: props.collapse }">
|
|
27
|
+
<transition name="sidebarLogoFade">
|
|
28
|
+
<router-link v-if="props.collapse" key="props.collapse" :title="title" class="sidebar-logo-link" to="/">
|
|
29
|
+
<img :src="logo" class="ut-collapse-img ut-sidebar-logo" />
|
|
30
|
+
</router-link>
|
|
31
|
+
<router-link v-else key="expand" :title="title" class="sidebar-logo-link" to="/">
|
|
32
|
+
<img :src="logo" class="ut-sidebar-logo h-10" />
|
|
33
|
+
<span class="sidebar-title">{{ title }}</span>
|
|
34
|
+
</router-link>
|
|
35
|
+
</transition>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<style lang="scss" scoped>
|
|
40
|
+
.sidebar-logo-container {
|
|
41
|
+
position: relative;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 48px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-align: center;
|
|
46
|
+
background-color: var(--udp-theme-sidebar-logo);
|
|
47
|
+
|
|
48
|
+
.sidebar-logo-link {
|
|
49
|
+
// margin-top: 5px;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
height: 100%;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
|
|
57
|
+
.ut-sidebar-logo {
|
|
58
|
+
height: 100%;
|
|
59
|
+
max-width: 67%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ut-collapse-img {
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.sidebar-title {
|
|
67
|
+
display: block;
|
|
68
|
+
// width: 140px;
|
|
69
|
+
// margin-top: 10px;
|
|
70
|
+
margin-left: 10px;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
74
|
+
font-size: 24px;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
color: var(--udp-theme-project-text);
|
|
77
|
+
text-align: left;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.collapses {
|
|
83
|
+
.sidebar-logo {
|
|
84
|
+
margin-right: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
svg {
|
|
89
|
+
width: 50px;
|
|
90
|
+
height: 50px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</style>
|
package/src/main.ts
CHANGED
|
@@ -32,23 +32,23 @@ import './style/index.scss';
|
|
|
32
32
|
|
|
33
33
|
// import SuTable from './components/SuTable/SuTable.vue';
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
// UtButton,
|
|
37
|
-
// utLov2,
|
|
38
|
-
// UGrid,
|
|
39
|
-
// UtDivider,
|
|
40
|
-
// UtModalForm2
|
|
41
|
-
// FormUpload2,
|
|
42
|
-
// UtForm2
|
|
43
|
-
|
|
44
|
-
// UtContent2,
|
|
45
|
-
// UtStampBadge2
|
|
46
|
-
// UtModalGrid2
|
|
47
|
-
// UtUpload2
|
|
48
|
-
// UtIconSelect,
|
|
49
|
-
// UtCalendar
|
|
50
|
-
// uAttachment
|
|
51
|
-
|
|
35
|
+
import {
|
|
36
|
+
// UtButton,
|
|
37
|
+
// utLov2,
|
|
38
|
+
// UGrid,
|
|
39
|
+
// UtDivider,
|
|
40
|
+
// UtModalForm2
|
|
41
|
+
// FormUpload2,
|
|
42
|
+
// UtForm2
|
|
43
|
+
UtGrid2
|
|
44
|
+
// UtContent2,
|
|
45
|
+
// UtStampBadge2
|
|
46
|
+
// UtModalGrid2
|
|
47
|
+
// UtUpload2
|
|
48
|
+
// UtIconSelect,
|
|
49
|
+
// UtCalendar
|
|
50
|
+
// uAttachment
|
|
51
|
+
} from './components/udp';
|
|
52
52
|
|
|
53
53
|
const app = createApp(App);
|
|
54
54
|
|
|
@@ -93,7 +93,7 @@ const init = ({ router, config, lang, views, env, tableConfig }) => {
|
|
|
93
93
|
// app.component('uAttachment', uAttachment).component('UGrid', UGrid);
|
|
94
94
|
// .component('UtDivider', UtDivider)
|
|
95
95
|
// app.component('UtModalForm2', UtModalForm2);
|
|
96
|
-
|
|
96
|
+
app.component('UtGrid2', UtGrid2);
|
|
97
97
|
// app.component('UtForm2', UtForm2);
|
|
98
98
|
// app.component('UtModalGrid2', UtModalGrid2);
|
|
99
99
|
// .component('UtIconSelect', UtIconSelect)
|
|
@@ -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-
|
|
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
|
-
|
|
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-10-29 16:32:37
|
|
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
|
+
}
|