@utogether/udp-core 2.0.0-beta.24 → 2.0.0-beta.25
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-QwBKrRZE.js +72 -0
- package/dist/404-Cr7MbzNV.js +72 -0
- package/dist/500-B7kCOeIA.js +77 -0
- package/dist/AuthorityInfo-Dwml2K4S.js +91 -0
- package/dist/AuthorityPanel-DzPhsPpa.js +98 -0
- package/dist/Company-BhOlvl7Q.js +21 -0
- package/dist/CompanyPanel-ByhY5-Sq.js +199 -0
- package/dist/DataSet-CuGZcKC-.js +141 -0
- package/dist/Department-QvngN63N.js +21 -0
- package/dist/DepartmentPanel-BCXqC39J.js +2 -0
- package/dist/DepartmentPanel-DntGycxr.js +242 -0
- package/dist/DesignPanel-BMN4DZ0R.js +1196 -0
- package/dist/DictView-ERFqZ5VD.js +100 -0
- package/dist/File-WJXjGYxr.js +89 -0
- package/dist/InvOrganization-BwMmD8Ua.js +76 -0
- package/dist/Org-HgnOWubi.js +76 -0
- package/dist/Preview-CVZdnHB1.js +45 -0
- package/dist/ReIcon-DecitXmg.js +413 -0
- package/dist/ReportDefine-BgLM-Rjk.js +10 -0
- package/dist/ReportDesign-CjfTyyy_.js +158 -0
- package/dist/ReportQuery-CP-E0Puv.js +101 -0
- package/dist/ReportQueryFrom-D7SPPAps.js +198 -0
- package/dist/ReportTemplate-DE25zc1f.js +162 -0
- package/dist/Role-K7v_ZhFE.js +21 -0
- package/dist/RoleAssign-C16fjLaX.js +22 -0
- package/dist/RolePanel-CV-xPlYJ.js +176 -0
- package/dist/RolePanel-DPCe9k8f.js +131 -0
- package/dist/ScrollPanel-DW30pGz1.js +88 -0
- package/dist/Staff-w2ly4qd0.js +22 -0
- package/dist/StaffInfo-DPDRpz6F.js +149 -0
- package/dist/StaffPanel-DI1eTTp9.js +143 -0
- package/dist/SysUser-BMTX1cJM.js +12 -0
- package/dist/SysUserPanel-xwZdVjdp.js +365 -0
- package/dist/SystemMenu-TXhiQZVm.js +154 -0
- package/dist/UserInfo-JQqw8FMT.js +194 -0
- package/dist/_plugin-vue_export-helper-C6QCLu9I.js +8 -0
- package/dist/api-BFNxcxSN.js +30 -0
- package/dist/authority-Bi6BGB5B.js +20 -0
- package/dist/await-to-js.es5-DkWYmPXW.js +10 -0
- package/dist/childView-Bk8OD9bV.js +181 -0
- package/dist/childView-CyrcwshT.js +184 -0
- package/dist/code-rule-QFrhqFrW.js +151 -0
- package/dist/contant-Q77dU_V3.js +4 -0
- package/dist/core.es.js +6 -23
- package/dist/cron-task-BpUDKEAU.js +131 -0
- package/dist/flow-task-DAc2NrDU.js +11 -0
- package/dist/frameView-Di0zJZUR.js +39 -0
- package/dist/img/v_img.svg +1 -1
- package/dist/layout-home-BVp7vYLR.js +239 -0
- package/dist/layoutView-DFUjrqAS.js +2662 -0
- package/dist/log-in-BrNB0mLz.js +117 -0
- package/dist/log-out-dYfqvzy6.js +111 -0
- package/dist/login-BdCDnuXL.js +233 -0
- package/dist/login-log-CJak-ANA.js +79 -0
- package/dist/lov-view-DkmG4K57.js +95 -0
- package/dist/menuInfo-kp2wNYOp.js +346 -0
- package/dist/mitt-CQgI7DYU.js +27 -0
- package/dist/pda-app-CA7YI37u.js +589 -0
- package/dist/redirect-N0k4tImU.js +16 -0
- package/dist/resource-CfQTHFcs.js +94 -0
- package/dist/router-CeluSGiD.js +1531 -0
- package/dist/su-welcome-JeiovGpe.js +799 -0
- package/dist/sys-config-Ddb3vBpK.js +316 -0
- package/dist/udp-core-Dhm-BlAs.js +2032 -0
- package/dist/udp-core.css +2 -1
- package/dist/useDataThemeChange-BCy8JBG7.js +226 -0
- package/dist/useNav-DY8FkltH.js +106 -0
- package/dist/utogether-l7JXs4Lv.js +4 -0
- package/dist/water-mark-WDQZ9YqB.js +119 -0
- package/dist/wecom-push-kWkAVRCj.js +77 -0
- package/package.json +1 -1
- package/src/api/index.ts +51 -51
- package/src/components/udp/index.ts +9 -8
- package/src/components/udp/lov/index.vue +430 -0
- package/src/components/udp/upload/index.vue +444 -444
- package/src/main.ts +110 -111
- package/src/plugins/vxe-table/index.ts +1 -1
- package/src/plugins/vxe-table/render.tsx +999 -998
- package/tsconfig.json +1 -1
- package/vite.config.ts +8 -3
- package/dist/403-DDCAPCYb.js +0 -65
- package/dist/404-BclWW4UB.js +0 -65
- package/dist/500-BAggMgTl.js +0 -67
- package/dist/AuthorityInfo-liCxYVNc.js +0 -4
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-Bd5A4CD-.js +0 -100
- package/dist/AuthorityPanel-CRlAwbaI.js +0 -4
- package/dist/AuthorityPanel.vue_vue_type_style_index_0_lang-DxhZjp1S.js +0 -114
- package/dist/Company-DjaOAaWM.js +0 -25
- package/dist/CompanyPanel-Dp_2z717.js +0 -206
- package/dist/DataSet-DT-rGICv.js +0 -147
- package/dist/Department-Bp5RGbl9.js +0 -25
- package/dist/DepartmentPanel-Bg4xM4Lx.js +0 -254
- package/dist/DesignPanel-BS2ioHd_.js +0 -4
- package/dist/DesignPanel.vue_vue_type_style_index_0_lang-DWwfRVCj.js +0 -1013
- package/dist/DictView-pYJXt6IS.js +0 -111
- package/dist/InvOrganization-D90gRzlN.js +0 -74
- package/dist/Org-Dk4KuIx2.js +0 -39
- package/dist/Preview-DpZR6uKs.js +0 -48
- package/dist/ReportDefine-PtJnfaLw.js +0 -10
- package/dist/ReportDesign-4HWkcTtA.js +0 -165
- package/dist/ReportQuery-BPY1lWFn.js +0 -75
- package/dist/ReportQueryFrom-CHFlkZ42.js +0 -4
- package/dist/ReportQueryFrom.vue_vue_type_style_index_0_lang-DbbQydKz.js +0 -178
- package/dist/ReportTemplate-C2F3oy8I.js +0 -161
- package/dist/Role-iTP6DYOi.js +0 -25
- package/dist/RoleAssign-DIYNHQeF.js +0 -26
- package/dist/RolePanel-0ojFIz9G.js +0 -4
- package/dist/RolePanel-B0Yr5vjo.js +0 -4
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CHAj3dCD.js +0 -132
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CXZBxePU.js +0 -154
- package/dist/ScrollPanel.vue_vue_type_style_index_0_lang-DtNzPRjS.js +0 -101
- package/dist/Staff-sftZ0bIV.js +0 -26
- package/dist/StaffInfo-BG2FMXzR.js +0 -4
- package/dist/StaffInfo.vue_vue_type_script_setup_true_lang-DzGn0pYY.js +0 -108
- package/dist/StaffPanel-BydqiitC.js +0 -4
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-C42Pnb-b.js +0 -154
- package/dist/SysUser-qMGVHpJ_.js +0 -15
- package/dist/SysUserPanel-Bh1HgSAr.js +0 -4
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-BBEMYLQN.js +0 -356
- package/dist/SystemMenu-DUbWmLip.js +0 -156
- package/dist/UserInfo-DNkiTdWm.js +0 -4
- package/dist/UserInfo.vue_vue_type_style_index_0_lang-B1eNklEd.js +0 -160
- package/dist/await-to-js.es5-Bv3Eu4mi.js +0 -10
- package/dist/childView-CjUjh8Da.js +0 -4
- package/dist/childView-DT9luEEK.js +0 -4
- package/dist/childView.vue_vue_type_style_index_0_lang-CgqosFJQ.js +0 -183
- package/dist/childView.vue_vue_type_style_index_0_lang-DkXHMFPd.js +0 -143
- package/dist/code-rule-uOazxFfn.js +0 -148
- package/dist/cron-task-DEykunjo.js +0 -135
- package/dist/flow-task-B07st2aD.js +0 -10
- package/dist/frameView-FxzlbkeM.js +0 -44
- package/dist/index-BnxyUGKa.js +0 -7944
- package/dist/layout-home-C0jme8Ju.js +0 -232
- package/dist/layoutView-BqMAHIxF.js +0 -3239
- package/dist/log-in-skZaWMBY.js +0 -117
- package/dist/log-out-BiND7muW.js +0 -130
- package/dist/login-C-184YPO.js +0 -235
- package/dist/login-log-BEHYT0v0.js +0 -70
- package/dist/lov-view-Df-swRfy.js +0 -99
- package/dist/menuInfo-CpyjX4a4.js +0 -4
- package/dist/menuInfo.vue_vue_type_style_index_0_lang-D09-OKji.js +0 -363
- package/dist/pda-app-DP87aTBc.js +0 -710
- package/dist/redirect-BqegffKC.js +0 -15
- package/dist/resource-CAldbnw4.js +0 -97
- package/dist/su-welcome-DoBUqadB.js +0 -42225
- package/dist/sys-config-hGuE7DUf.js +0 -385
- package/dist/useNav-Cf_e5pBY.js +0 -92
- package/dist/utogether-MlnyYtNS.js +0 -4
- package/dist/wecom-push-DR7NsNro.js +0 -70
package/src/api/index.ts
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-17 16:24:43
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2026-03-31 10:11:22
|
|
6
|
-
* @Description: API封装
|
|
7
|
-
*/
|
|
8
|
-
import { http } from '@utogether/utils';
|
|
9
|
-
// import { http } from '../utils/udp/http';
|
|
10
|
-
import { getEnv } from '../config';
|
|
11
|
-
|
|
12
|
-
// 路由相关服务
|
|
13
|
-
export const getServiceApi = () => {
|
|
14
|
-
return {
|
|
15
|
-
post: (url: string, data: object, config?) => http.post(`${getBaseURL(url)}${url}`, data, config),
|
|
16
|
-
get: (url: string, params: object, config?) => http.get(`${getBaseURL(url)}${url}`, params, config),
|
|
17
|
-
put: (url: string, params: object) => http.put(`${getBaseURL(url)}${url}`, params),
|
|
18
|
-
delete: (url: string, params: object) => http.delete(`${getBaseURL(url)}${url}`, params)
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const setRouter = router => {
|
|
23
|
-
http.setRouter(router);
|
|
24
|
-
};
|
|
25
|
-
export const setBaseUrl = router => {
|
|
26
|
-
http.setBaseUrl(router);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const origin = window.location.origin + '/gateway';
|
|
30
|
-
|
|
31
|
-
export const getBaseURL = (url?) => {
|
|
32
|
-
const whiteList = ['/uums/', '/upfm/', '/urpt/', '/usch/'];
|
|
33
|
-
if (url && getEnv().VITE_DEBUG === 'true' && !whiteList.some(item => url.includes(item))) {
|
|
34
|
-
return getEnv().VITE_DEBUG_URL;
|
|
35
|
-
}
|
|
36
|
-
return getEnv().VITE_BASE_URL === 'origin' ? origin : getEnv().VITE_BASE_URL;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const getDebugBaseURL = () => {
|
|
40
|
-
console.log('getDebugBaseURL', getDebugURL());
|
|
41
|
-
return {
|
|
42
|
-
post: (url: string, data: object, config?) => http.post(`${getDebugURL()}${url}`, data, config),
|
|
43
|
-
get: (url: string, params: object, config?) => http.get(`${getDebugURL()}${url}`, params, config),
|
|
44
|
-
put: (url: string, params: object) => http.put(`${getDebugURL()}${url}`, params),
|
|
45
|
-
delete: (url: string, params: object) => http.delete(`${getDebugURL()}${url}`, params)
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const getDebugURL = () => {
|
|
50
|
-
return getEnv().VITE_DEBUG_URL;
|
|
51
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-17 16:24:43
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2026-03-31 10:11:22
|
|
6
|
+
* @Description: API封装
|
|
7
|
+
*/
|
|
8
|
+
import { http } from '@utogether/utils';
|
|
9
|
+
// import { http } from '../utils/udp/http';
|
|
10
|
+
import { getEnv } from '../config';
|
|
11
|
+
|
|
12
|
+
// 路由相关服务
|
|
13
|
+
export const getServiceApi = () => {
|
|
14
|
+
return {
|
|
15
|
+
post: (url: string, data: object, config?) => http.post(`${getBaseURL(url)}${url}`, data, config),
|
|
16
|
+
get: (url: string, params: object, config?) => http.get(`${getBaseURL(url)}${url}`, params, config),
|
|
17
|
+
put: (url: string, params: object) => http.put(`${getBaseURL(url)}${url}`, params),
|
|
18
|
+
delete: (url: string, params: object) => http.delete(`${getBaseURL(url)}${url}`, params)
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const setRouter = router => {
|
|
23
|
+
http.setRouter(router);
|
|
24
|
+
};
|
|
25
|
+
export const setBaseUrl = router => {
|
|
26
|
+
http.setBaseUrl(router);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const origin = window.location.origin + '/gateway';
|
|
30
|
+
|
|
31
|
+
export const getBaseURL = (url?) => {
|
|
32
|
+
const whiteList = ['/uath/', '/uwfl/', '/uums/', '/upfm/', '/urpt/', '/usch/'];
|
|
33
|
+
if (url && getEnv().VITE_DEBUG === 'true' && !whiteList.some(item => url.includes(item))) {
|
|
34
|
+
return getEnv().VITE_DEBUG_URL;
|
|
35
|
+
}
|
|
36
|
+
return getEnv().VITE_BASE_URL === 'origin' ? origin : getEnv().VITE_BASE_URL;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const getDebugBaseURL = () => {
|
|
40
|
+
console.log('getDebugBaseURL', getDebugURL());
|
|
41
|
+
return {
|
|
42
|
+
post: (url: string, data: object, config?) => http.post(`${getDebugURL()}${url}`, data, config),
|
|
43
|
+
get: (url: string, params: object, config?) => http.get(`${getDebugURL()}${url}`, params, config),
|
|
44
|
+
put: (url: string, params: object) => http.put(`${getDebugURL()}${url}`, params),
|
|
45
|
+
delete: (url: string, params: object) => http.delete(`${getDebugURL()}${url}`, params)
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const getDebugURL = () => {
|
|
50
|
+
return getEnv().VITE_DEBUG_URL;
|
|
51
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import UtGrid2 from './grid/index.vue';
|
|
2
|
-
import UtForm2 from './form/form.vue';
|
|
3
|
-
import UtContent2 from './content/index.vue';
|
|
4
|
-
import FormUpload2 from './form-upload/form-upload.vue';
|
|
5
|
-
import UtStampBadge2 from './ut-stamp-badge/index.vue';
|
|
6
|
-
import UtUpload2 from './upload/index.vue';
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import UtGrid2 from './grid/index.vue';
|
|
2
|
+
import UtForm2 from './form/form.vue';
|
|
3
|
+
import UtContent2 from './content/index.vue';
|
|
4
|
+
import FormUpload2 from './form-upload/form-upload.vue';
|
|
5
|
+
import UtStampBadge2 from './ut-stamp-badge/index.vue';
|
|
6
|
+
import UtUpload2 from './upload/index.vue';
|
|
7
|
+
import UtLov2 from './lov/index.vue';
|
|
8
|
+
|
|
9
|
+
export { UtGrid2, UtForm2, UtContent2, FormUpload2, UtStampBadge2, UtUpload2, UtLov2 };
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ut-lov-wrapper">
|
|
3
|
+
<vxe-modal
|
|
4
|
+
v-if="mode === 'vxe'"
|
|
5
|
+
v-model="showLovModal"
|
|
6
|
+
:width="modalWidth"
|
|
7
|
+
:destroy-on-close="false"
|
|
8
|
+
:title="lovTitle"
|
|
9
|
+
:transfer="transfer"
|
|
10
|
+
height="80%"
|
|
11
|
+
resize
|
|
12
|
+
esc-closable
|
|
13
|
+
show-footer
|
|
14
|
+
:class-name="className"
|
|
15
|
+
:before-hide-method="beforeHideMethod"
|
|
16
|
+
>
|
|
17
|
+
<template #default>
|
|
18
|
+
<vxe-grid ref="xgrid" v-bind="data" @cell-dblclick="onCellClick" />
|
|
19
|
+
</template>
|
|
20
|
+
<template #footer>
|
|
21
|
+
<vxe-button :content="$t('message.btn.cancel')" icon="ri-close-line" status="warning" @click="onClose" />
|
|
22
|
+
<vxe-button :content="$t('message.btn.confirm')" icon="ri-save-3-line" status="primary" @click="onConfirm" />
|
|
23
|
+
</template>
|
|
24
|
+
</vxe-modal>
|
|
25
|
+
<el-dialog
|
|
26
|
+
v-else
|
|
27
|
+
v-model="showLovModal"
|
|
28
|
+
:width="modalWidth"
|
|
29
|
+
:show-close="false"
|
|
30
|
+
:title="lovTitle"
|
|
31
|
+
:append-to-body="transfer"
|
|
32
|
+
draggable
|
|
33
|
+
destroy-on-close
|
|
34
|
+
close-on-press-escape
|
|
35
|
+
>
|
|
36
|
+
<template #default>
|
|
37
|
+
<div style="height: 360px">
|
|
38
|
+
<vxe-grid
|
|
39
|
+
ref="xgrid"
|
|
40
|
+
v-bind="data"
|
|
41
|
+
:column-config="{ resizable: true }"
|
|
42
|
+
@cell-dblclick="onCellClick"
|
|
43
|
+
@columns-change="onColumnChange"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
<template #footer>
|
|
48
|
+
<vxe-button :content="$t('message.btn.cancel')" icon="ri-close-line" status="warning" @click="onClose" />
|
|
49
|
+
<vxe-button :content="$t('message.btn.confirm')" icon="ri-save-3-line" status="primary" @click="onConfirm" />
|
|
50
|
+
</template>
|
|
51
|
+
</el-dialog>
|
|
52
|
+
<vxe-input
|
|
53
|
+
v-model="record[displayName || field]"
|
|
54
|
+
:clearable="!disabled && clearable"
|
|
55
|
+
:disabled="disabled"
|
|
56
|
+
:editable="editable"
|
|
57
|
+
:placeholder="placeholder"
|
|
58
|
+
style="width: 100%"
|
|
59
|
+
type="search"
|
|
60
|
+
@search-click="onSeach"
|
|
61
|
+
@clear="onClear"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script lang="ts">
|
|
67
|
+
export default {
|
|
68
|
+
name: 'UtLov'
|
|
69
|
+
};
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<script setup lang="ts">
|
|
73
|
+
// @ts-nocheck
|
|
74
|
+
import { ref, reactive, getCurrentInstance, nextTick } from 'vue';
|
|
75
|
+
import { VxeGridProps } from 'vxe-table';
|
|
76
|
+
import to from 'await-to-js';
|
|
77
|
+
import { clone, toDateString, isEmpty, isFunction } from 'xe-utils';
|
|
78
|
+
import { useRender, cookies, delay } from '@utogether/utils';
|
|
79
|
+
import type { IFormItemProps, IRecord } from '../../types';
|
|
80
|
+
|
|
81
|
+
export interface IProps {
|
|
82
|
+
record: object;
|
|
83
|
+
defaultParams?: object;
|
|
84
|
+
code: string;
|
|
85
|
+
field: string;
|
|
86
|
+
displayName?: string;
|
|
87
|
+
placeholder?: string;
|
|
88
|
+
mode?: string;
|
|
89
|
+
clearable?: boolean;
|
|
90
|
+
multiple?: boolean;
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
autoLoad?: boolean;
|
|
93
|
+
readonly?: boolean;
|
|
94
|
+
editable?: boolean;
|
|
95
|
+
transfer?: boolean;
|
|
96
|
+
checkMethod?: Function;
|
|
97
|
+
}
|
|
98
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
99
|
+
record: () => {
|
|
100
|
+
return {};
|
|
101
|
+
},
|
|
102
|
+
defaultParams: () => {
|
|
103
|
+
return {};
|
|
104
|
+
},
|
|
105
|
+
mode: 'vxe',
|
|
106
|
+
placeholder: '请选择',
|
|
107
|
+
clearable: true,
|
|
108
|
+
multiple: false,
|
|
109
|
+
disabled: false,
|
|
110
|
+
editable: false,
|
|
111
|
+
autoLoad: true
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const instance = getCurrentInstance()!;
|
|
115
|
+
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
116
|
+
|
|
117
|
+
const minWidth = 600;
|
|
118
|
+
const showLovModal = ref(false);
|
|
119
|
+
const modalWidth = ref(minWidth);
|
|
120
|
+
const lovTitle = ref('');
|
|
121
|
+
const className = ref('vxe-table--ignore-clear');
|
|
122
|
+
|
|
123
|
+
const data = reactive<VxeGridProps>({
|
|
124
|
+
loading: false,
|
|
125
|
+
border: true,
|
|
126
|
+
pagerConfig: {},
|
|
127
|
+
formConfig: { titleWidth: 90, titleAlign: 'right', items: [] },
|
|
128
|
+
height: 'auto',
|
|
129
|
+
editConfig: {},
|
|
130
|
+
rowConfig: { keyField: '_X_ROW_KEY' },
|
|
131
|
+
columnConfig: {
|
|
132
|
+
resizable: true,
|
|
133
|
+
// 鼠标移到行是否要高亮显示
|
|
134
|
+
isHover: true
|
|
135
|
+
},
|
|
136
|
+
proxyConfig: {
|
|
137
|
+
form: true, // 查询是需要启用表单代理
|
|
138
|
+
autoLoad: false,
|
|
139
|
+
response: {
|
|
140
|
+
result: 'list',
|
|
141
|
+
total: 'total'
|
|
142
|
+
},
|
|
143
|
+
ajax: {
|
|
144
|
+
query: ({ page, form }) => {
|
|
145
|
+
const commonParam = cookies.get('kCookies_param') ? JSON.parse(cookies.get('kCookies_param')) : {};
|
|
146
|
+
const params = { pageNum: page.currentPage, pageSize: page.pageSize };
|
|
147
|
+
let queryParams = Object.assign(params, commonParam, props.defaultParams, form);
|
|
148
|
+
if (!props.readonly) {
|
|
149
|
+
const { field, displayName } = props;
|
|
150
|
+
// 非只读时,意味着可录入文本,此时查询是需要加上录入的文本内容作为条件
|
|
151
|
+
queryParams[displayName || field] = props.record[displayName || field];
|
|
152
|
+
}
|
|
153
|
+
// console.log(queryParams);
|
|
154
|
+
queryParams = formatterParam(queryParams);
|
|
155
|
+
// console.log("-------------------------------------");
|
|
156
|
+
// console.log("lovData=", lovData);
|
|
157
|
+
// console.log("-------------------------------------");
|
|
158
|
+
if (lovData.lovType !== 'url') {
|
|
159
|
+
queryParams.lovCode = props.code;
|
|
160
|
+
return serviceApi.get('/upfm/v1/lovViewHeader/listBySql', queryParams);
|
|
161
|
+
}
|
|
162
|
+
return serviceApi.get(lovData.lovUrl, queryParams);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
checkboxConfig: {
|
|
167
|
+
checkMethod: ({ row }) => onCheckMethod(row, props)
|
|
168
|
+
},
|
|
169
|
+
radioConfig: {
|
|
170
|
+
checkMethod: ({ row }) => onCheckMethod(row, props)
|
|
171
|
+
},
|
|
172
|
+
columns: []
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// const displayName = ref(null);
|
|
176
|
+
let lovData = undefined;
|
|
177
|
+
let dataList = [];
|
|
178
|
+
|
|
179
|
+
const formatterParam = params => {
|
|
180
|
+
const columns = dataList.filter(col => ['date', 'month'].includes(col.fieldType) && col.isSearch);
|
|
181
|
+
columns.forEach(col => {
|
|
182
|
+
if (col.fieldType === 'date') {
|
|
183
|
+
params[col.field] = toDateString(params[col.field], 'yyyy-MM-dd 00:00:00');
|
|
184
|
+
} else if (col.fieldType === 'month') {
|
|
185
|
+
params[col.field] = toDateString(params[col.field], 'yyyy-MM');
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
return params;
|
|
189
|
+
};
|
|
190
|
+
// 查询字段
|
|
191
|
+
const getFormItem = () => {
|
|
192
|
+
const items = clone(dataList, true).filter(col => col.isSearch === 'Y');
|
|
193
|
+
if (!items.length) return;
|
|
194
|
+
// console.log(items);
|
|
195
|
+
const isCollapse = items.length > 2;
|
|
196
|
+
const forItems: IFormItemProps[] = items
|
|
197
|
+
.sort((a, b) => a.seqNo - b.seqNo)
|
|
198
|
+
.map((item: IRecord, idx) => {
|
|
199
|
+
return {
|
|
200
|
+
field: item.colField,
|
|
201
|
+
title: item.colTitle,
|
|
202
|
+
span: 8,
|
|
203
|
+
folding: idx > 1,
|
|
204
|
+
itemRender: getItemRender(item)
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
searchBtn.collapseNode = isCollapse;
|
|
208
|
+
if (isCollapse) {
|
|
209
|
+
// 按钮设置为 折叠节点并将搜索按钮插入到第一列的最后
|
|
210
|
+
forItems.splice(2, 0, searchBtn);
|
|
211
|
+
} else {
|
|
212
|
+
forItems.push(searchBtn);
|
|
213
|
+
}
|
|
214
|
+
data.formConfig.items = forItems;
|
|
215
|
+
};
|
|
216
|
+
const searchBtn: IFormItemProps = {
|
|
217
|
+
span: 8,
|
|
218
|
+
align: 'right',
|
|
219
|
+
collapseNode: false,
|
|
220
|
+
itemRender: {
|
|
221
|
+
name: 'VxeButtonGroup',
|
|
222
|
+
options: [
|
|
223
|
+
{
|
|
224
|
+
type: 'submit',
|
|
225
|
+
submit: 'submit',
|
|
226
|
+
content: 'message.btn.search',
|
|
227
|
+
status: 'primary',
|
|
228
|
+
icon: 'ri-search-line'
|
|
229
|
+
// props: {
|
|
230
|
+
// },
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: 'reset',
|
|
234
|
+
name: 'reset',
|
|
235
|
+
content: 'message.btn.reset',
|
|
236
|
+
status: 'info',
|
|
237
|
+
icon: 'ri-refresh-line'
|
|
238
|
+
// props: {
|
|
239
|
+
// },
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// console.log("useRender", useRender);
|
|
246
|
+
const renderHook = useRender();
|
|
247
|
+
|
|
248
|
+
const getItemRender = item => {
|
|
249
|
+
if (['date', 'month'].includes(item.fieldType)) {
|
|
250
|
+
const valueFormat = item.fieldType === 'date' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM';
|
|
251
|
+
return renderHook.renderDate({ type: item.fieldType, valueFormat });
|
|
252
|
+
} else if (item.fieldType === 'dictCode') {
|
|
253
|
+
return renderHook.renderDict(item.dictCode);
|
|
254
|
+
}
|
|
255
|
+
return { name: 'VxeInput' };
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// 获取columns
|
|
259
|
+
const getColumns = () => {
|
|
260
|
+
const columns = clone(dataList, true).filter((col: IRecord) => col.isCol === 'Y');
|
|
261
|
+
const colWidth = columns.reduce((curv, prev: IRecord) => curv + +prev.colWidth, 65);
|
|
262
|
+
modalWidth.value = colWidth < minWidth ? minWidth : colWidth > 900 ? 900 : colWidth;
|
|
263
|
+
data.columns = columns
|
|
264
|
+
.sort((a, b) => a.seqNo - b.seqNo)
|
|
265
|
+
.map(col => {
|
|
266
|
+
const fieldType = col.fieldType;
|
|
267
|
+
const dictCode = ['formatDict', col.dictCode];
|
|
268
|
+
return {
|
|
269
|
+
field: col.colField,
|
|
270
|
+
title: col.colTitle,
|
|
271
|
+
minWidth: col.colWidth,
|
|
272
|
+
formatter: fieldType === 'date' ? ['formatDate'] : col.fieldType === 'dictCode' ? dictCode : null
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
if (props.multiple) {
|
|
276
|
+
data.columns.unshift({ type: 'checkbox', width: 45, align: 'center' });
|
|
277
|
+
} else {
|
|
278
|
+
data.columns.unshift({ type: 'radio', width: 45, align: 'center' });
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
// 获取grid配置
|
|
283
|
+
const xgrid = ref(null);
|
|
284
|
+
|
|
285
|
+
const getGridConfig = async () => {
|
|
286
|
+
data.loading = true;
|
|
287
|
+
const url = '/upfm/v1/lovViewHeader/detailByViewCode';
|
|
288
|
+
const [err, res]: [Error, any] = await to(serviceApi.get(url, { lovCode: props.code }));
|
|
289
|
+
data.loading = false;
|
|
290
|
+
if (err) onClose();
|
|
291
|
+
data.loading = true;
|
|
292
|
+
lovTitle.value = res?.lovTitle || res?.lovName;
|
|
293
|
+
dataList = res?.lineList || [];
|
|
294
|
+
lovData = res;
|
|
295
|
+
getColumns();
|
|
296
|
+
getFormItem();
|
|
297
|
+
await delay(30);
|
|
298
|
+
await nextTick();
|
|
299
|
+
// console.log("-------------------------------------");
|
|
300
|
+
// console.log("props=", props);
|
|
301
|
+
// console.log("xgrid=", xgrid.value);
|
|
302
|
+
// console.log("-------------------------------------");
|
|
303
|
+
props.autoLoad && xgrid.value?.commitProxy('query');
|
|
304
|
+
data.loading = false;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
const onCheckMethod = (row, props) => {
|
|
308
|
+
if (isFunction(props.checkMethod)) {
|
|
309
|
+
return props.checkMethod(row);
|
|
310
|
+
}
|
|
311
|
+
return true;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
const onSeach = async () => {
|
|
315
|
+
if (props.disabled) return;
|
|
316
|
+
getGridConfig();
|
|
317
|
+
await nextTick();
|
|
318
|
+
showLovModal.value = true;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
const onClear = () => {
|
|
322
|
+
emit('clear', '');
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
// 双击
|
|
326
|
+
const onCellClick = ({ row }) => {
|
|
327
|
+
const record = !props.multiple ? row : [row];
|
|
328
|
+
// 禁止选中的数据,双击也不能选中
|
|
329
|
+
if (isFunction(props.checkMethod) && !props.checkMethod(row)) return;
|
|
330
|
+
emit('change', record, lovData.valueField);
|
|
331
|
+
onClose();
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const onColumnChange = async () => {
|
|
335
|
+
await nextTick();
|
|
336
|
+
xgrid.value?.commitProxy('query');
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const onConfirm = () => {
|
|
340
|
+
const grid = xgrid.value;
|
|
341
|
+
const record = !props.multiple ? grid.getRadioRecord() : grid.getCheckboxRecords();
|
|
342
|
+
!isEmpty(record) && emit('change', record, lovData.valueField);
|
|
343
|
+
onClose();
|
|
344
|
+
};
|
|
345
|
+
/** 输入框显示值 */
|
|
346
|
+
// const setDisplayLabel = row => {
|
|
347
|
+
// let value = row[lovData.valueField];
|
|
348
|
+
// if (props.multiple) {
|
|
349
|
+
// value = row.map(m => m[lovData.valueField]).join();
|
|
350
|
+
// }
|
|
351
|
+
// Object.assign(props.record, { [props.field]: value });
|
|
352
|
+
// };
|
|
353
|
+
|
|
354
|
+
// 关闭Lov
|
|
355
|
+
const onClose = () => {
|
|
356
|
+
dataList.length = 0;
|
|
357
|
+
showLovModal.value = false;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
const beforeHideMethod = ({ type }) => {
|
|
361
|
+
// console.log("cccc", type);
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
const emit = defineEmits<{
|
|
365
|
+
(e: 'clear', str: ''): void;
|
|
366
|
+
(e: 'change', record: any, field: string): void;
|
|
367
|
+
}>();
|
|
368
|
+
|
|
369
|
+
console.log('props --lov');
|
|
370
|
+
</script>
|
|
371
|
+
|
|
372
|
+
<style lang="scss">
|
|
373
|
+
.ut-lov-wrapper {
|
|
374
|
+
.vxe-pager .vxe-pager--sizes {
|
|
375
|
+
display: inline-block;
|
|
376
|
+
width: 7em !important;
|
|
377
|
+
text-align: center;
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.el-dialog__header {
|
|
382
|
+
padding: 0.6em 4.6em 0.6em 1em;
|
|
383
|
+
margin-right: 0;
|
|
384
|
+
background-color: #f8f8f8;
|
|
385
|
+
border-bottom: 1px solid #ebeef5;
|
|
386
|
+
|
|
387
|
+
.el-dialog__title {
|
|
388
|
+
font-size: 1.1em;
|
|
389
|
+
font-weight: 600;
|
|
390
|
+
color: #000 !important;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.el-dialog__body {
|
|
395
|
+
padding: 5px 6px;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.el-dialog__footer {
|
|
399
|
+
padding: 5px 6px;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.vxe-grid {
|
|
403
|
+
.vxe-form {
|
|
404
|
+
.vxe-form--item {
|
|
405
|
+
.vxe-form--item-title-label {
|
|
406
|
+
font-weight: 500 !important;
|
|
407
|
+
color: #000 !important;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.vxe-input--date-picker-suffix {
|
|
411
|
+
color: #000 !important;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.vxe-cell {
|
|
417
|
+
.vxe-cell--label {
|
|
418
|
+
font-weight: 500 !important;
|
|
419
|
+
color: #000 !important;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.vxe-input {
|
|
425
|
+
i[class*='vxe-icon-'] {
|
|
426
|
+
color: #6a6a6a !important;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
</style>
|