@utogether/udp-core 1.0.1-beta.1 → 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.
- package/dist/{403-Dp617CWX.js → 403-BBQoJwTM.js} +1 -1
- package/dist/{404-Cz_Axb6Y.js → 404-BbJPSIWM.js} +1 -1
- package/dist/{500-BGCtRNse.js → 500-BtFL9R4M.js} +1 -1
- package/dist/{AuthorityInfo-DGGfm7IS.js → AuthorityInfo-DhiwCeLN.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BqccGW7v.js → AuthorityInfo.vue_vue_type_style_index_0_lang-Duyweh89.js} +1 -1
- package/dist/{Company-IV3GTnzY.js → Company-CGqmslx-.js} +3 -3
- package/dist/{CompanyPanel-qV-_VtoL.js → CompanyPanel-hlDsxD-6.js} +1 -1
- package/dist/{Department-B3W-OxW8.js → Department-BZyJtacc.js} +3 -3
- package/dist/{DepartmentPanel-Cw3OWxE7.js → DepartmentPanel-D-a_EBFt.js} +1 -1
- package/dist/{DesignPanel-BFxR2fHJ.js → DesignPanel-Bl4luWDV.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DljbeFba.js → DesignPanel.vue_vue_type_style_index_0_lang-I8C3iGvz.js} +2 -2
- package/dist/{DictView-C-i7e4hZ.js → DictView-B4a7Hs1X.js} +1 -1
- package/dist/{InvOrganization-cfT6riGU.js → InvOrganization-q4T3y8dQ.js} +1 -1
- package/dist/{Org-CA7vTDIF.js → Org-BTGTrAVz.js} +1 -1
- package/dist/{Preview-BlDMmpdR.js → Preview-pHD84xqI.js} +1 -1
- package/dist/{ReportDefine-Cub_85LA.js → ReportDefine-DnnCNQWS.js} +1 -1
- package/dist/{ReportDesign-hFhq5UVE.js → ReportDesign-BnI_Q4pg.js} +2 -2
- package/dist/{ReportQuery-ChkWEyxT.js → ReportQuery-Dby2MmtM.js} +1 -1
- package/dist/{ReportQueryFrom-KVyD_8Dj.js → ReportQueryFrom-Blm1N8P1.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CLNODquq.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CnG_Ybnt.js} +1 -1
- package/dist/{ReportTemplate-ag9NDvh2.js → ReportTemplate-D65RXRY_.js} +1 -1
- package/dist/{Role-_q3lQ8CZ.js → Role-eFZoTpXc.js} +3 -3
- package/dist/{RoleAssign-DZb9IRsm.js → RoleAssign-D9-Y3UNz.js} +3 -3
- package/dist/{RolePanel-CsLsz-Ds.js → RolePanel-CoUOc3sX.js} +1 -1
- package/dist/{RolePanel-BQb1LlhD.js → RolePanel-DlFw6HSf.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-BrnRgHEk.js → RolePanel.vue_vue_type_script_setup_true_lang-Clwk-MHw.js} +3 -3
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-cmW7zBLu.js → RolePanel.vue_vue_type_script_setup_true_lang-DKHgNWQP.js} +1 -1
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CaFKRwXu.js → ScrollPanel.vue_vue_type_style_index_0_lang-M2FQJwPU.js} +1 -1
- package/dist/{Staff-BSf9Ypbk.js → Staff-DFBLCsAd.js} +3 -3
- package/dist/{StaffInfo-BNKasyMF.js → StaffInfo-d2CK0oBA.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DDZ7ukd0.js → StaffInfo.vue_vue_type_script_setup_true_lang-4m8wK9tq.js} +1 -1
- package/dist/{StaffPanel-Bpq0WVlH.js → StaffPanel-D6aWLKN3.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-BhiJ0Q-Q.js → StaffPanel.vue_vue_type_script_setup_true_lang-C7YT2CVb.js} +2 -2
- package/dist/{SysUser-FAABuNti.js → SysUser-BdZvYxQH.js} +2 -2
- package/dist/{SysUserPanel-PxJeOgHm.js → SysUserPanel-BIVa6LLr.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-njefUln5.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BsBKpYR7.js} +1 -1
- package/dist/{SystemMenu-C-7NAGon.js → SystemMenu-C-5VKlHK.js} +16 -16
- package/dist/{UserInfo-ClXKtyGo.js → UserInfo-DqXCRZts.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-8N7P4Hl7.js → UserInfo.vue_vue_type_style_index_0_lang-N3TwfpPx.js} +1 -1
- package/dist/{childView-C_HmDQNd.js → childView-B2lSsqS3.js} +1 -1
- package/dist/{childView-uUlBcTza.js → childView-DRUNqgjI.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-y0sDvYx5.js → childView.vue_vue_type_style_index_0_lang-B9XBDDU_.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-Ckjmw6wJ.js → childView.vue_vue_type_style_index_0_lang-oGriyFTv.js} +1 -1
- package/dist/{code-rule-AgCVDKFy.js → code-rule-DZC9T6cl.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-C6FgQxTi.js → cron-task-BJwPeA5F.js} +1 -1
- package/dist/{frameView-BDgISK7N.js → frameView-C6wkvok-.js} +1 -1
- package/dist/index-DZc3qRTx.js +2650 -0
- package/dist/{layoutView-yb3DV2DQ.js → layoutView-CeJBpZb_.js} +2 -2
- package/dist/{login-RRpljbkm.js → login-BOxwzwdB.js} +2 -2
- package/dist/{lov-view-C9-rjzZR.js → lov-view-DRF-99U4.js} +2 -2
- package/dist/{menuInfo-CzPQyFhp.js → menuInfo-3Sjvs9nM.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-BumXunCg.js → menuInfo.vue_vue_type_style_index_0_lang-DrQ560nm.js} +91 -90
- package/dist/{pda-app-Dvy3U-b6.js → pda-app-B9tn7jdv.js} +1 -1
- package/dist/{resource-Fy0lFkSV.js → resource-BqnxbQNe.js} +1 -1
- package/dist/{su-welcome-DYvSCUST.js → su-welcome-VwifUK_O.js} +1 -1
- package/dist/{sys-config-DJ1vNQTy.js → sys-config-C0-gSBFO.js} +1 -1
- package/dist/{utogether-CjmJiHoE.js → utogether-Di1byIum.js} +1 -1
- package/package.json +18 -18
- package/src/components/udp/form-upload.vue +71 -20
- package/src/main.ts +109 -109
- package/src/plugins/vxe-table/index.ts +53 -46
- package/src/views/system/menu/SystemMenu.vue +197 -197
- package/src/views/system/menu/menuInfo.vue +11 -9
- package/dist/index-DzOzUkf6.js +0 -3388
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2022-11-04 14:53:36
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-07-
|
|
5
|
+
* @LastEditTime: 2025-07-20 17:23:11
|
|
6
6
|
* @Description: form upload
|
|
7
7
|
-->
|
|
8
8
|
<template>
|
|
@@ -10,15 +10,17 @@
|
|
|
10
10
|
<el-upload
|
|
11
11
|
v-model:file-list="fileList"
|
|
12
12
|
:action="baseUrl + '/ufil/file/uploadMultipart'"
|
|
13
|
+
:disabled="dataStatus === 'detail'"
|
|
13
14
|
list-type="picture-card"
|
|
14
15
|
:headers="headers"
|
|
15
16
|
:before-upload="beforeUpload"
|
|
16
17
|
:on-success="onSuccess"
|
|
17
18
|
:on-preview="onPreview"
|
|
18
19
|
:on-remove="handleRemove"
|
|
20
|
+
:http-request="httpRequest"
|
|
19
21
|
>
|
|
20
22
|
<template #default>
|
|
21
|
-
<i class="ri-add-line" />
|
|
23
|
+
<i v-if="fileList.length < limit && dataStatus !== 'detail'" class="ri-add-line" />
|
|
22
24
|
</template>
|
|
23
25
|
</el-upload>
|
|
24
26
|
</div>
|
|
@@ -31,15 +33,16 @@ export default { name: 'FormUpload' };
|
|
|
31
33
|
<script setup lang="ts">
|
|
32
34
|
import { ref, computed, getCurrentInstance } from 'vue';
|
|
33
35
|
import { cookies } from '@utogether/utils';
|
|
34
|
-
|
|
35
|
-
// import { loadEnv } from "@build/index";
|
|
36
|
-
|
|
37
|
-
// const { VITE_BASE_URL } = loadEnv();
|
|
36
|
+
import compressorjs from 'compressorjs';
|
|
38
37
|
|
|
39
38
|
export interface IProps {
|
|
40
39
|
record: object;
|
|
41
40
|
field: string;
|
|
41
|
+
dataStatus: string;
|
|
42
42
|
limit?: number;
|
|
43
|
+
compassorSize?: number;
|
|
44
|
+
quality?: number;
|
|
45
|
+
size?: number;
|
|
43
46
|
beforeUpload?: Function;
|
|
44
47
|
onSuccess?: Function;
|
|
45
48
|
onRemove?: Function;
|
|
@@ -49,11 +52,19 @@ const props = withDefaults(defineProps<IProps>(), {
|
|
|
49
52
|
return {};
|
|
50
53
|
},
|
|
51
54
|
field: '',
|
|
52
|
-
|
|
55
|
+
dataStatus: '',
|
|
56
|
+
size: 60,
|
|
57
|
+
limit: 1,
|
|
58
|
+
quality: 0.6,
|
|
59
|
+
compassorSize: 2
|
|
53
60
|
});
|
|
54
61
|
|
|
55
62
|
const instance = getCurrentInstance()!;
|
|
56
63
|
const baseUrl = instance.appContext.config.globalProperties.$url;
|
|
64
|
+
const viewerApi = instance.appContext.config.globalProperties.$viewerApi;
|
|
65
|
+
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
66
|
+
|
|
67
|
+
const imgTypes = ['image/gif', 'image/jpeg', 'image/png'];
|
|
57
68
|
|
|
58
69
|
const headers = computed(() => {
|
|
59
70
|
const kTOKENKEY = 'authorized-token';
|
|
@@ -68,23 +79,59 @@ const headers = computed(() => {
|
|
|
68
79
|
const fileList = ref([]);
|
|
69
80
|
const loading = ref(false);
|
|
70
81
|
const display = ref('flex');
|
|
82
|
+
const image_size = ref(props.size + 'px');
|
|
83
|
+
const process_size = ref(props.size - 10 + 'px');
|
|
71
84
|
|
|
72
85
|
const beforeUpload = file => {
|
|
73
86
|
if (props.beforeUpload) {
|
|
74
87
|
return props.beforeUpload(file);
|
|
75
88
|
}
|
|
76
|
-
console.log(file);
|
|
77
89
|
loading.value = true;
|
|
78
90
|
return true;
|
|
79
91
|
};
|
|
80
92
|
|
|
81
|
-
const
|
|
93
|
+
const httpRequest = options => {
|
|
94
|
+
if (imgTypes.includes(options.file.type) && options.file.size > 1024 * 1024 * props.compassorSize) {
|
|
95
|
+
return new Promise((resolve, reject) => {
|
|
96
|
+
new compressorjs(options.file, {
|
|
97
|
+
quality: props.quality,
|
|
98
|
+
mimeType: options.file.type,
|
|
99
|
+
success(result: File) {
|
|
100
|
+
const file = new File([result], result.name, { type: result.type });
|
|
101
|
+
uploadProcess(resolve, reject, file);
|
|
102
|
+
console.log({ result, file });
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
} else {
|
|
107
|
+
return new Promise((resolve, reject) => uploadProcess(resolve, reject, options.file));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const uploadProcess = (resolve, reject, file) => {
|
|
112
|
+
const formBody = new FormData();
|
|
113
|
+
formBody.append('file', file);
|
|
114
|
+
|
|
115
|
+
return serviceApi
|
|
116
|
+
.post('/ufil/file/uploadMultipart', formBody, { headers })
|
|
117
|
+
.then(async data => {
|
|
118
|
+
loading.value = false;
|
|
119
|
+
file.path = data;
|
|
120
|
+
resolve(file);
|
|
121
|
+
})
|
|
122
|
+
.catch(() => {
|
|
123
|
+
loading.value = false;
|
|
124
|
+
reject(null);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const onSuccess = file => {
|
|
82
129
|
loading.value = false;
|
|
83
130
|
if (props.onSuccess) {
|
|
84
|
-
return props.onSuccess(
|
|
131
|
+
return props.onSuccess(file);
|
|
85
132
|
} else {
|
|
86
133
|
const field = props.field;
|
|
87
|
-
Object.assign(props.record, { [field]:
|
|
134
|
+
Object.assign(props.record, { [field]: file.path });
|
|
88
135
|
display.value = props.limit > fileList.value.length ? 'flex' : 'none';
|
|
89
136
|
}
|
|
90
137
|
};
|
|
@@ -99,8 +146,12 @@ const handleRemove = (uploadFile, uploadFiles) => {
|
|
|
99
146
|
emit('remove', uploadFile, fileList);
|
|
100
147
|
};
|
|
101
148
|
|
|
102
|
-
const onPreview =
|
|
103
|
-
|
|
149
|
+
const onPreview = file => {
|
|
150
|
+
if (imgTypes.includes(file.raw.type)) {
|
|
151
|
+
const src = `${baseUrl}/ufil${file.response.path}`;
|
|
152
|
+
viewerApi({ options: { toolbar: true, url: 'data-source' }, images: [{ src, 'data-source': src }] });
|
|
153
|
+
} else {
|
|
154
|
+
}
|
|
104
155
|
};
|
|
105
156
|
const emit = defineEmits<{
|
|
106
157
|
(e: 'remove', file: File, fileList: any): void;
|
|
@@ -111,21 +162,21 @@ const emit = defineEmits<{
|
|
|
111
162
|
.ut-upload-wrapper {
|
|
112
163
|
.el-upload--picture-card {
|
|
113
164
|
display: v-bind(display);
|
|
114
|
-
width:
|
|
115
|
-
height:
|
|
165
|
+
width: v-bind(image_size) !important;
|
|
166
|
+
height: v-bind(image_size) !important;
|
|
116
167
|
}
|
|
117
168
|
|
|
118
169
|
.el-upload-list--picture-card .el-upload-list__item {
|
|
119
|
-
width:
|
|
120
|
-
height:
|
|
170
|
+
width: v-bind(image_size) !important;
|
|
171
|
+
height: v-bind(image_size) !important;
|
|
121
172
|
}
|
|
122
173
|
|
|
123
174
|
.el-upload-list--picture-card .el-progress {
|
|
124
|
-
width:
|
|
175
|
+
width: v-bind(process_size) !important;
|
|
125
176
|
|
|
126
177
|
.el-progress-circle {
|
|
127
|
-
width:
|
|
128
|
-
height:
|
|
178
|
+
width: v-bind(process_size) !important;
|
|
179
|
+
height: v-bind(process_size) !important;
|
|
129
180
|
}
|
|
130
181
|
}
|
|
131
182
|
}
|
package/src/main.ts
CHANGED
|
@@ -1,109 +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
|
-
// 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
|
-
// .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
|
+
/*
|
|
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-07-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
}
|