@utogether/udp-core 1.0.1-beta.5 → 1.0.1-beta.7
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-CP2RkkAy.js → 403-BQZ5OAKL.js} +10 -10
- package/dist/{404-DwK-0wNQ.js → 404-H55ex36i.js} +4 -4
- package/dist/{500-CLbJDqnd.js → 500-bbrspTnK.js} +1 -1
- package/dist/{AuthorityInfo-Bi1_uhMu.js → AuthorityInfo-BWni4UPQ.js} +1 -1
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-7WtOL6Hs.js +100 -0
- package/dist/{Company-B--cokc6.js → Company-CuebFrQ0.js} +3 -3
- package/dist/{CompanyPanel-B_gmcZ9L.js → CompanyPanel-DxPdJs6x.js} +6 -6
- package/dist/{Department-DbKdyNzK.js → Department-D2a6Juur.js} +3 -3
- package/dist/{DepartmentPanel-BmEttboJ.js → DepartmentPanel-C_s2R9yl.js} +24 -23
- package/dist/{DesignPanel-LL68_36s.js → DesignPanel-CexZj3HF.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DWPmFegv.js → DesignPanel.vue_vue_type_style_index_0_lang-DfmysqwB.js} +25 -24
- package/dist/{DictView-B8j-EWx5.js → DictView-C0GS72rG.js} +19 -18
- package/dist/{InvOrganization-DnGQlESM.js → InvOrganization-a1tQ2CEH.js} +8 -7
- package/dist/Org-DifvzLLy.js +35 -0
- package/dist/{Preview-yot4NBW5.js → Preview-BOv5j9i6.js} +1 -1
- package/dist/{ReportDefine-DHadqNYy.js → ReportDefine-Dli1Q0TB.js} +1 -1
- package/dist/{ReportDesign-CBihGRth.js → ReportDesign-zSWkcL_O.js} +37 -36
- package/dist/{ReportQuery-CwHQ6LUU.js → ReportQuery-D5r3bvFc.js} +1 -1
- package/dist/{ReportQueryFrom-ie6lQcGL.js → ReportQueryFrom-DiostHrX.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-B8LJNK0m.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Cr2eKMmr.js} +1 -1
- package/dist/{ReportTemplate-B2Smwo-z.js → ReportTemplate-CYy4cZHQ.js} +24 -24
- package/dist/{Role-Cf7DB7uS.js → Role-BFQFxfQS.js} +6 -6
- package/dist/{RoleAssign-upUnqs_i.js → RoleAssign-BIdWSLTR.js} +8 -8
- package/dist/{RolePanel-EXL_FLvM.js → RolePanel-C7ybSknr.js} +1 -1
- package/dist/{RolePanel-BBGDGK8V.js → RolePanel-KC-UgmtF.js} +1 -1
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-C91CJO4e.js +132 -0
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DF8qJKwW.js → RolePanel.vue_vue_type_script_setup_true_lang-C_ZsMf1f.js} +40 -34
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-DbBGg32H.js → ScrollPanel.vue_vue_type_style_index_0_lang-botBBgto.js} +17 -17
- package/dist/{Staff-DYu5ZEyR.js → Staff-CY0DLsTN.js} +3 -3
- package/dist/{StaffInfo-CHvNGjtz.js → StaffInfo-DA7p265h.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-XRJVEJ-s.js → StaffInfo.vue_vue_type_script_setup_true_lang-f29A44gS.js} +5 -5
- package/dist/{StaffPanel-C-ygEY65.js → StaffPanel-DYP-mMp9.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-BvLrF4Yw.js → StaffPanel.vue_vue_type_script_setup_true_lang-C0YAG2xV.js} +6 -6
- package/dist/{SysUser-BHk_szpK.js → SysUser-FqS3Ctne.js} +2 -2
- package/dist/{SysUserPanel-DFvzA5d-.js → SysUserPanel-C_t6F99T.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-B9zUXXwa.js → SysUserPanel.vue_vue_type_script_setup_true_lang-CKZjy0OF.js} +93 -86
- package/dist/{SystemMenu-5TK9ZA11.js → SystemMenu-ChFrMzRg.js} +14 -13
- package/dist/{UserInfo-Bx3zQqHa.js → UserInfo-I36LAXVj.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-C2sqUQdg.js → UserInfo.vue_vue_type_style_index_0_lang-BGY-LYeL.js} +28 -25
- package/dist/await-to-js.es5-BtRbN2QH.js +10 -0
- package/dist/{childView-BSUWnii7.js → childView-CYpuOzRx.js} +1 -1
- package/dist/{childView-CFC3gA_U.js → childView-Csnlaqfs.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-EcT-Dux7.js → childView.vue_vue_type_style_index_0_lang-B8EnA03l.js} +18 -17
- package/dist/{childView.vue_vue_type_style_index_0_lang-WQVLSJR8.js → childView.vue_vue_type_style_index_0_lang-DNVlDM_a.js} +10 -9
- package/dist/{code-rule-DybjhotB.js → code-rule-DHBSC5Qp.js} +14 -13
- package/dist/core.es.js +2 -2
- package/dist/{cron-task-DGdknqaF.js → cron-task-CiI1MFla.js} +8 -7
- package/dist/{frameView-BOOZRv1S.js → frameView-ZWKlbz9p.js} +1 -1
- package/dist/index-COBMRlmJ.js +5379 -0
- package/dist/{layoutView-BWeDLY9C.js → layoutView-5OsbpP0u.js} +11 -10
- package/dist/{login-BcuCHhGE.js → login-C55sa9gN.js} +26 -25
- package/dist/{lov-view-DDgzqYSW.js → lov-view-DFfaUQ5m.js} +9 -8
- package/dist/{menuInfo-B3MOxomU.js → menuInfo-CZdLtLjN.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-BXMrNMUs.js → menuInfo.vue_vue_type_style_index_0_lang-DgG0aHRy.js} +16 -15
- package/dist/{pda-app-Dy9WMHEG.js → pda-app-fLe8mrx-.js} +213 -196
- package/dist/{resource-BoCP7-dM.js → resource-ohWKO6Fh.js} +20 -20
- package/dist/{su-welcome-DXpI1MHr.js → su-welcome-_UZTfrXX.js} +84 -84
- package/dist/{sys-config-BiUWzxGU.js → sys-config-DVuBsK7p.js} +19 -18
- package/dist/udp-core.css +1 -1
- package/dist/{utogether-DXDcsKt7.js → utogether-CxobZqGL.js} +1 -1
- package/package.json +18 -18
- package/src/components/SuScrollTree/ScrollPanel.vue +3 -3
- package/src/components/udp/flip-down/FlipCard/flip-card.vue +251 -0
- package/src/components/udp/flip-down/FlipCard/interfaces.ts +4 -0
- package/src/components/udp/flip-down/FlipClock/flip-clock.vue +113 -0
- package/src/components/udp/grid.vue +12 -6
- package/src/components/udp/index.ts +2 -2
- package/src/components/udp/lov.vue +1 -1
- package/src/components/udp/modal-grid.vue +288 -297
- package/src/components/udp/utils.ts +4 -11
- package/src/layout/components/lay-search/index.vue +25 -25
- package/src/main.ts +18 -10
- package/src/plugins/i18n/zh.ts +348 -338
- package/src/plugins/vxe-table/index.ts +2 -2
- package/src/plugins/vxe-table/render.tsx +95 -18
- package/src/views/login/login-view.vue +1 -1
- package/src/views/system/role/AuthorityInfo.vue +19 -15
- package/src/views/system/role/Role.vue +1 -5
- package/src/views/system/role/RolePanel.vue +11 -2
- package/src/views/system/role/UserInfo.vue +5 -3
- package/src/views/system/role-assign/RoleAssign.vue +57 -57
- package/src/views/system/role-assign/RolePanel.vue +139 -136
- package/src/views/system/sysUser/SysUserPanel.vue +37 -37
- package/src/views/uapp/pda/pda-app.vue +41 -10
- package/src/views/udev/dict/DictView.vue +6 -1
- package/src/views/udev/dict/childView.vue +1 -6
- package/src/views/ufile/aggregation/File.vue +5 -5
- package/src/views/ufile/file/water-mark.vue +14 -14
- package/src/views/uhome/su-welcome.vue +2 -2
- package/src/views/ulogin/login.vue +8 -0
- package/src/views/urpt/design/DesignPanel.vue +10 -33
- package/src/views/urpt/design/ReportDesign.vue +12 -16
- package/src/views/urpt/static-resource/resource.vue +3 -3
- package/src/views/urpt/template/ReportTemplate.vue +7 -7
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-RUhvzu76.js +0 -101
- package/dist/Org-Dg9Xkd34.js +0 -34
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-BwfL_JVZ.js +0 -125
- package/dist/index-BDE4-ZvN.js +0 -5091
|
@@ -1,297 +1,288 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-24 17:53:49
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-07-22 11:42:46
|
|
6
|
-
* @Description: 共用弹框
|
|
7
|
-
-->
|
|
8
|
-
<template>
|
|
9
|
-
<div>
|
|
10
|
-
<vxe-modal
|
|
11
|
-
v-model="showModal"
|
|
12
|
-
:title="title"
|
|
13
|
-
:width="width"
|
|
14
|
-
:height="height"
|
|
15
|
-
:loading="data.loading"
|
|
16
|
-
:show-footer="showFooter"
|
|
17
|
-
resize
|
|
18
|
-
destroy-on-close
|
|
19
|
-
@close="close"
|
|
20
|
-
>
|
|
21
|
-
<template #default>
|
|
22
|
-
<slot />
|
|
23
|
-
<vxe-grid
|
|
24
|
-
ref="xGrid"
|
|
25
|
-
v-bind="data"
|
|
26
|
-
resizable
|
|
27
|
-
v-on="attrs.events || {}"
|
|
28
|
-
@edit-activated="onEditActived"
|
|
29
|
-
@toolbarButtonClick="toolbarButtonClick"
|
|
30
|
-
@toolbarToolClick="toolbarButtonClick"
|
|
31
|
-
@cell-click="cellClick"
|
|
32
|
-
/>
|
|
33
|
-
</template>
|
|
34
|
-
<template #footer>
|
|
35
|
-
<slot name="bottom" />
|
|
36
|
-
<ut-button icon="ri-close-line" status="warning" content="cancel" @tap="close" />
|
|
37
|
-
<ut-button icon="ri-save-3-line" content="confirm" @tap="onConfirm" />
|
|
38
|
-
</template>
|
|
39
|
-
</vxe-modal>
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
<script lang="ts">
|
|
43
|
-
export default {
|
|
44
|
-
name: 'UtModalGrid'
|
|
45
|
-
};
|
|
46
|
-
</script>
|
|
47
|
-
<script lang="ts" setup>
|
|
48
|
-
// @ts-nocheck
|
|
49
|
-
import { onBeforeMount, reactive, ref, toRaw, getCurrentInstance, useAttrs } from 'vue';
|
|
50
|
-
import { useI18n } from 'vue-i18n';
|
|
51
|
-
import { VxeGridProps } from 'vxe-table';
|
|
52
|
-
import { formatGridItems, i18nColums, formatRules, successMessage, warnMessage } from '@utogether/utils';
|
|
53
|
-
import { clone, isFunction } from 'xe-utils';
|
|
54
|
-
import {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
//
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
showLoading,
|
|
290
|
-
hiddenLoading,
|
|
291
|
-
close
|
|
292
|
-
});
|
|
293
|
-
onBeforeMount(() => {
|
|
294
|
-
showModal.value = true;
|
|
295
|
-
setGridConfig();
|
|
296
|
-
});
|
|
297
|
-
</script>
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-24 17:53:49
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-07-22 11:42:46
|
|
6
|
+
* @Description: 共用弹框
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<div>
|
|
10
|
+
<vxe-modal
|
|
11
|
+
v-model="showModal"
|
|
12
|
+
:title="title"
|
|
13
|
+
:width="width"
|
|
14
|
+
:height="height"
|
|
15
|
+
:loading="data.loading"
|
|
16
|
+
:show-footer="showFooter"
|
|
17
|
+
resize
|
|
18
|
+
destroy-on-close
|
|
19
|
+
@close="close"
|
|
20
|
+
>
|
|
21
|
+
<template #default>
|
|
22
|
+
<slot />
|
|
23
|
+
<vxe-grid
|
|
24
|
+
ref="xGrid"
|
|
25
|
+
v-bind="data"
|
|
26
|
+
resizable
|
|
27
|
+
v-on="attrs.events || {}"
|
|
28
|
+
@edit-activated="onEditActived"
|
|
29
|
+
@toolbarButtonClick="toolbarButtonClick"
|
|
30
|
+
@toolbarToolClick="toolbarButtonClick"
|
|
31
|
+
@cell-click="cellClick"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
<template #footer>
|
|
35
|
+
<slot name="bottom" />
|
|
36
|
+
<ut-button icon="ri-close-line" status="warning" content="cancel" @tap="close" />
|
|
37
|
+
<ut-button icon="ri-save-3-line" content="confirm" @tap="onConfirm" />
|
|
38
|
+
</template>
|
|
39
|
+
</vxe-modal>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
export default {
|
|
44
|
+
name: 'UtModalGrid'
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
47
|
+
<script lang="ts" setup>
|
|
48
|
+
// @ts-nocheck
|
|
49
|
+
import { onBeforeMount, reactive, ref, toRaw, getCurrentInstance, useAttrs } from 'vue';
|
|
50
|
+
import { useI18n } from 'vue-i18n';
|
|
51
|
+
import { VxeGridProps } from 'vxe-table';
|
|
52
|
+
import { formatGridItems, i18nColums, formatRules, successMessage, warnMessage } from '@utogether/utils';
|
|
53
|
+
import { clone, isFunction, merge } from 'xe-utils';
|
|
54
|
+
import { queryAll, query, del, save, footerSumMethod, getToolBarConfig, onCheckMethod, getAttrs } from './utils';
|
|
55
|
+
|
|
56
|
+
// import type { IRecord, IFormItemProps, ITableColProps } from '../../types';
|
|
57
|
+
|
|
58
|
+
export interface IProps {
|
|
59
|
+
checkMethod?: Function;
|
|
60
|
+
columns: Array<ITableColProps>; // 列表行
|
|
61
|
+
defaultValue?: IRecord;
|
|
62
|
+
defaultParams?: IRecord;
|
|
63
|
+
gridOptions?: IRecord;
|
|
64
|
+
auth?: IRecord;
|
|
65
|
+
url?: string; // 查询服务路径
|
|
66
|
+
submitUrl?: string; // 确认
|
|
67
|
+
checkRowKeys?: Array<string>; // 默认选中列表
|
|
68
|
+
items?: Array<IFormItemProps>; // 查询条件
|
|
69
|
+
title?: string; // 标题
|
|
70
|
+
width?: number | string;
|
|
71
|
+
height?: number;
|
|
72
|
+
editable?: boolean; // 可编辑
|
|
73
|
+
needExport?: boolean; // 是否需要导出
|
|
74
|
+
showFooter?: boolean; // 显示底部按钮
|
|
75
|
+
addChild?: boolean; // 可编辑
|
|
76
|
+
autoClose?: boolean; // 组件自主关闭
|
|
77
|
+
autoLoad?: boolean; // 是否自动加载查询数据
|
|
78
|
+
}
|
|
79
|
+
const attrs: IRecord = getAttrs(useAttrs());
|
|
80
|
+
|
|
81
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
82
|
+
gridOptions: () => {
|
|
83
|
+
return {};
|
|
84
|
+
},
|
|
85
|
+
items: () => [],
|
|
86
|
+
columns: () => [],
|
|
87
|
+
checkRowKeys: () => [],
|
|
88
|
+
addChild: false,
|
|
89
|
+
editable: true,
|
|
90
|
+
showFooter: false,
|
|
91
|
+
autoLoad: true,
|
|
92
|
+
needExport: true,
|
|
93
|
+
autoClose: true,
|
|
94
|
+
width: '520',
|
|
95
|
+
height: 420,
|
|
96
|
+
title: '数据记录',
|
|
97
|
+
url: '',
|
|
98
|
+
submitUrl: ''
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const showModal = ref(false);
|
|
102
|
+
|
|
103
|
+
const xGrid = ref(null);
|
|
104
|
+
const instance = getCurrentInstance()!;
|
|
105
|
+
|
|
106
|
+
const hasAuthority = instance.appContext.config.globalProperties.$hasAuthority;
|
|
107
|
+
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
108
|
+
const $mode = instance.appContext.config.globalProperties.$mode;
|
|
109
|
+
|
|
110
|
+
const { t } = useI18n();
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @description: colum 统一添加国家化
|
|
114
|
+
*/
|
|
115
|
+
const getColumns = () => {
|
|
116
|
+
const col = props.columns.map(m => {
|
|
117
|
+
if (!props.editable) {
|
|
118
|
+
m.editRender = { enabled: false };
|
|
119
|
+
} else if (!m.type && !m.editRender && props.editable && !!m.editable) {
|
|
120
|
+
m.editRender = { name: 'VxeInput' };
|
|
121
|
+
}
|
|
122
|
+
return m;
|
|
123
|
+
});
|
|
124
|
+
return i18nColums(col);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const getItems = () => {
|
|
128
|
+
if (!props.items.length) return props.items;
|
|
129
|
+
return formatGridItems(clone(props.items, true));
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @description: 根据items 获取必填选
|
|
134
|
+
*/
|
|
135
|
+
const getRules = () => {
|
|
136
|
+
if (!props.columns.length) return {};
|
|
137
|
+
return formatRules(props.columns, t);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const data = reactive<VxeGridProps>({
|
|
141
|
+
loading: false,
|
|
142
|
+
border: true,
|
|
143
|
+
pagerConfig: {},
|
|
144
|
+
formConfig: {},
|
|
145
|
+
toolbarConfig: { enabled: false },
|
|
146
|
+
height: 'auto',
|
|
147
|
+
editConfig: {},
|
|
148
|
+
rowConfig: { keyField: '_X_ROW_KEY' },
|
|
149
|
+
editRules: getRules(),
|
|
150
|
+
proxyConfig: {
|
|
151
|
+
form: true, // 查询是需要启用表单代理
|
|
152
|
+
autoLoad: props.autoLoad,
|
|
153
|
+
ajax: {
|
|
154
|
+
queryAll: ({ form }) => queryAll(props, serviceApi, form),
|
|
155
|
+
query: ({ page, form }) => query(props, form, page, serviceApi, $mode),
|
|
156
|
+
delete: ({ body: { removeRecords } }) => del(serviceApi, removeRecords, props),
|
|
157
|
+
save: ({ body }) => Promise.all(save(serviceApi, body, props))
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
checkboxConfig: {
|
|
161
|
+
checkMethod: ({ row }) => onCheckMethod(row, props),
|
|
162
|
+
checkRowKeys: props.checkRowKeys
|
|
163
|
+
},
|
|
164
|
+
columns: getColumns()
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// 确认数据
|
|
168
|
+
const onConfirm = async () => {
|
|
169
|
+
let records = null;
|
|
170
|
+
const type = props.columns[0].type;
|
|
171
|
+
if (type === 'checkbox') {
|
|
172
|
+
records = xGrid.value.getCheckboxRecords();
|
|
173
|
+
} else if (type === 'radio') {
|
|
174
|
+
records = xGrid.value.getRadioRecord();
|
|
175
|
+
} else {
|
|
176
|
+
records = xGrid.value.getTableData().fullData;
|
|
177
|
+
}
|
|
178
|
+
if (type === 'checkbox' && !records.length && !props.addChild) {
|
|
179
|
+
return warnMessage(t('message.selectedRecord'));
|
|
180
|
+
} else if (type === 'radio' && !records) {
|
|
181
|
+
return warnMessage(t('message.selectedRecord'));
|
|
182
|
+
}
|
|
183
|
+
if (isFunction(attrs.beforeConfirm) && !attrs.beforeConfirm(records)) return;
|
|
184
|
+
const { submitUrl } = props;
|
|
185
|
+
// 服务submitUrl
|
|
186
|
+
if (submitUrl) {
|
|
187
|
+
showLoading();
|
|
188
|
+
let res;
|
|
189
|
+
try {
|
|
190
|
+
records.forEach(record => Object.assign(record, props.defaultParams));
|
|
191
|
+
res = await serviceApi.post(submitUrl, records);
|
|
192
|
+
} finally {
|
|
193
|
+
res && emit('confirm', res);
|
|
194
|
+
res && successMessage(t('message.operateSuccess'));
|
|
195
|
+
close();
|
|
196
|
+
hiddenLoading();
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
props.autoClose && close();
|
|
200
|
+
emit('confirm', records);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
// 请求数据
|
|
204
|
+
const refreshData = () => {
|
|
205
|
+
xGrid.value.commitProxy('query');
|
|
206
|
+
};
|
|
207
|
+
const refreshColumn = () => {
|
|
208
|
+
data.editRules = getRules();
|
|
209
|
+
xGrid.value.refreshColumn();
|
|
210
|
+
};
|
|
211
|
+
const getInstance = () => {
|
|
212
|
+
return toRaw(xGrid.value);
|
|
213
|
+
};
|
|
214
|
+
const cellClick = ({ row }) => {
|
|
215
|
+
const type = props.columns[0].type;
|
|
216
|
+
if (type === 'checkbox') {
|
|
217
|
+
xGrid.value.setCheckboxRow(row, true);
|
|
218
|
+
} else if (type === 'radio') {
|
|
219
|
+
xGrid.value.setRadioRow(row);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
// 单元格被激活编辑激活回调
|
|
223
|
+
const onEditActived = data => {
|
|
224
|
+
emit('actived', data);
|
|
225
|
+
};
|
|
226
|
+
const toolbarButtonClick = ({ code }) => {
|
|
227
|
+
emit('buttonClick', code);
|
|
228
|
+
};
|
|
229
|
+
const showLoading = () => {
|
|
230
|
+
data.loading = true;
|
|
231
|
+
};
|
|
232
|
+
const hiddenLoading = () => {
|
|
233
|
+
data.loading = false;
|
|
234
|
+
};
|
|
235
|
+
const emit = defineEmits<{
|
|
236
|
+
(e: 'close'): void;
|
|
237
|
+
(e: 'confirm', record: any): void;
|
|
238
|
+
(e: 'actived', record: any): void;
|
|
239
|
+
(e: 'buttonClick', code: string): void;
|
|
240
|
+
}>();
|
|
241
|
+
// 关闭弹框
|
|
242
|
+
const close = () => {
|
|
243
|
+
if (isFunction(attrs.beforeClose) && !attrs.beforeClose()) return;
|
|
244
|
+
showModal.value = false;
|
|
245
|
+
emit('close');
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @description: 设置grid参数
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
const setGridConfig = () => {
|
|
253
|
+
// 查询
|
|
254
|
+
if (props.items.length) {
|
|
255
|
+
data.formConfig = {
|
|
256
|
+
titleWidth: 100,
|
|
257
|
+
titleAlign: 'right',
|
|
258
|
+
items: getItems(),
|
|
259
|
+
rules: formatRules(props.items, t),
|
|
260
|
+
validConfig: { showMessage: false }
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
// tool bar
|
|
264
|
+
const obj = getToolBarConfig(data, props, attrs, hasAuthority);
|
|
265
|
+
Object.assign(data, obj);
|
|
266
|
+
|
|
267
|
+
// 合计方法
|
|
268
|
+
if (attrs.mergeFooter) {
|
|
269
|
+
data.showFooter = true;
|
|
270
|
+
data.footerMethod = ({ columns, data }) => footerSumMethod({ columns, data }, attrs.mergeFooter);
|
|
271
|
+
}
|
|
272
|
+
merge(data, props.gridOptions);
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// 子组件需对外暴露方法
|
|
276
|
+
defineExpose({
|
|
277
|
+
refreshData,
|
|
278
|
+
refreshColumn,
|
|
279
|
+
getInstance,
|
|
280
|
+
showLoading,
|
|
281
|
+
hiddenLoading,
|
|
282
|
+
close
|
|
283
|
+
});
|
|
284
|
+
onBeforeMount(() => {
|
|
285
|
+
showModal.value = true;
|
|
286
|
+
setGridConfig();
|
|
287
|
+
});
|
|
288
|
+
</script>
|
|
@@ -217,8 +217,7 @@ export const getExportConfig = attrs => {
|
|
|
217
217
|
types: ['xlsx', 'csv'],
|
|
218
218
|
modes: ['current', 'selected', 'all'],
|
|
219
219
|
useStyle: true,
|
|
220
|
-
sheetMethod: ({ worksheet }) =>
|
|
221
|
-
attrs.onSheetMethod ? attrs.onSheetMethod(worksheet) : onSheetMethod(worksheet),
|
|
220
|
+
sheetMethod: ({ worksheet }) => (attrs.onSheetMethod ? attrs.onSheetMethod(worksheet) : onSheetMethod(worksheet)),
|
|
222
221
|
columnFilterMethod: ({ column }) =>
|
|
223
222
|
attrs.columnFilter
|
|
224
223
|
? !!attrs.columnFilter(column)
|
|
@@ -259,19 +258,14 @@ export const getToolBarConfig = (data, props, attrs, hasAuthority) => {
|
|
|
259
258
|
toolButtons.reverse().forEach(btn => {
|
|
260
259
|
!buttons.some(s => s.code === btn.code) && buttons.unshift(btn);
|
|
261
260
|
if (attrs.authPrefix && !['print', 'export'].includes(btn.auth)) {
|
|
262
|
-
btn.auth =
|
|
263
|
-
attrs.authPrefix +
|
|
264
|
-
btn.auth.slice(0, 1).toLocaleUpperCase() +
|
|
265
|
-
btn.auth.slice(1).toLocaleLowerCase();
|
|
261
|
+
btn.auth = attrs.authPrefix + btn.auth.slice(0, 1).toLocaleUpperCase() + btn.auth.slice(1).toLocaleLowerCase();
|
|
266
262
|
}
|
|
267
263
|
});
|
|
268
264
|
|
|
269
265
|
buttons = formatButton(buttons, props.auth).filter(button => {
|
|
270
266
|
const flag = button.auth ? hasAuthority(button.auth) : true;
|
|
271
267
|
if (button.dropdowns?.length) {
|
|
272
|
-
button.dropdowns = button.dropdowns.filter(
|
|
273
|
-
btn => !btn.auth || (btn.auth && hasAuthority(btn.auth))
|
|
274
|
-
);
|
|
268
|
+
button.dropdowns = button.dropdowns.filter(btn => !btn.auth || (btn.auth && hasAuthority(btn.auth)));
|
|
275
269
|
}
|
|
276
270
|
return flag;
|
|
277
271
|
});
|
|
@@ -400,8 +394,7 @@ export const formatItems = (items, status, span = 24) => {
|
|
|
400
394
|
disabled = true;
|
|
401
395
|
item.placeholder = null;
|
|
402
396
|
} else {
|
|
403
|
-
disabled =
|
|
404
|
-
item.disabled === false ? item.disabled : item.disabled || item.itemRender?.props?.disabled;
|
|
397
|
+
disabled = item.disabled === false ? item.disabled : item.disabled || item.itemRender?.props?.disabled;
|
|
405
398
|
}
|
|
406
399
|
let itemRender = {
|
|
407
400
|
name: 'VxeInput',
|