@utogether/udp-core 1.0.1-beta.26 → 1.0.1-beta.27
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/build/plugins.ts +37 -39
- package/dist/{403-CRaWlpO4.js → 403-A9aD_bZN.js} +1 -1
- package/dist/{404-CO17saLh.js → 404-DREd70aQ.js} +1 -1
- package/dist/{500-CZSo9D7b.js → 500-C5qVXkGt.js} +1 -1
- package/dist/{AuthorityInfo-B5CBOT-E.js → AuthorityInfo-CYO2IVau.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BAUfnndO.js → AuthorityInfo.vue_vue_type_style_index_0_lang-V7e_KwWp.js} +1 -1
- package/dist/{Company-DyulR9z3.js → Company-CaottHQO.js} +3 -3
- package/dist/{CompanyPanel-B1FObbfo.js → CompanyPanel-B3hOiXqj.js} +1 -1
- package/dist/{Department-BwqHGgU6.js → Department-CHkuRvJN.js} +3 -3
- package/dist/{DepartmentPanel-BdSArfIb.js → DepartmentPanel-DieWfIxW.js} +1 -1
- package/dist/{DesignPanel-CM7POFYL.js → DesignPanel-REWXp3x4.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-L2wuXnfS.js → DesignPanel.vue_vue_type_style_index_0_lang-Df0xc5XP.js} +2 -2
- package/dist/{DictView-Cz1HXcLI.js → DictView-DnpDHskG.js} +1 -1
- package/dist/{InvOrganization-B570Y7CZ.js → InvOrganization-DoIsDrAx.js} +1 -1
- package/dist/{Org-4_PyJCn0.js → Org-C4P5Cwia.js} +1 -1
- package/dist/{Preview-QgpTybOh.js → Preview-d90pQdFJ.js} +1 -1
- package/dist/{ReportDefine-BCqCBlDX.js → ReportDefine-DNrp4lFP.js} +1 -1
- package/dist/{ReportDesign-BjxuRAVL.js → ReportDesign-Ch8x6_mW.js} +2 -2
- package/dist/{ReportQuery-CEKmzHT5.js → ReportQuery-C1yR0ULS.js} +1 -1
- package/dist/{ReportQueryFrom-BTppicSp.js → ReportQueryFrom-BKwf61CL.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CNyJtLRf.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-D2ddteNz.js} +1 -1
- package/dist/{ReportTemplate-BK4hDrL1.js → ReportTemplate-HLHli4Cc.js} +1 -1
- package/dist/{Role-BWXsp5qm.js → Role-4GbuIhk6.js} +3 -3
- package/dist/{RoleAssign-BhdOusLw.js → RoleAssign-FGrSCg5R.js} +3 -3
- package/dist/{RolePanel-D5EvY_-Q.js → RolePanel-BcCozGfv.js} +1 -1
- package/dist/{RolePanel-BAc0l-2F.js → RolePanel-Ce1eKsM8.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DFzyHc1T.js → RolePanel.vue_vue_type_script_setup_true_lang-BiOcU5GE.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DLCmeXCd.js → RolePanel.vue_vue_type_script_setup_true_lang-CqER1M9Y.js} +3 -3
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-ie9JsdEr.js → ScrollPanel.vue_vue_type_style_index_0_lang-BbgS5f79.js} +1 -1
- package/dist/{Staff-Dz1Wf9V4.js → Staff-CBt_0rqg.js} +3 -3
- package/dist/{StaffInfo-FQZG2fGB.js → StaffInfo-RCdWZr1r.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-Do1yHo6J.js → StaffInfo.vue_vue_type_script_setup_true_lang-Dm8Yin3r.js} +1 -1
- package/dist/{StaffPanel-CU-StSY2.js → StaffPanel-2ka-H3IV.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-DgXY4cfW.js → StaffPanel.vue_vue_type_script_setup_true_lang-B0u-PqTe.js} +2 -2
- package/dist/{SysUser-B7uyZeA3.js → SysUser-Cs7uN3HU.js} +2 -2
- package/dist/{SysUserPanel-DqQ3U-nX.js → SysUserPanel-Df3qGMep.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-oggT9dvZ.js → SysUserPanel.vue_vue_type_script_setup_true_lang-ClwozbZE.js} +17 -14
- package/dist/{SystemMenu-CkilYlRc.js → SystemMenu-BMYVQd-E.js} +2 -2
- package/dist/{UserInfo-B_u9-T_L.js → UserInfo-DDk2iOqY.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-DdeVvUqP.js → UserInfo.vue_vue_type_style_index_0_lang-CEccCnDi.js} +1 -1
- package/dist/{childView-1gXcTDxu.js → childView-C7u4Budn.js} +1 -1
- package/dist/{childView-DWEAMuXh.js → childView-DFPGu0W-.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-feFKg1Nw.js → childView.vue_vue_type_style_index_0_lang-B3fNaibG.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CG2wvaUS.js → childView.vue_vue_type_style_index_0_lang-BUMcbqzM.js} +1 -1
- package/dist/{code-rule-D1Ft0jcV.js → code-rule-BcaRQ1zV.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-1nATKU7t.js → cron-task-DJQLZCsO.js} +1 -1
- package/dist/{frameView-Cfzchx0E.js → frameView-uPEaJRC7.js} +1 -1
- package/dist/index-D7BXpJPu.js +2904 -0
- package/dist/{layoutView-B4YfJktL.js → layoutView-zw1-fplL.js} +1059 -1053
- package/dist/{login-C4w14hqN.js → login-M-rLGYIn.js} +1 -1
- package/dist/{lov-view-CKfqoFML.js → lov-view-BVfIna0M.js} +2 -2
- package/dist/{menuInfo-HGi2h2YV.js → menuInfo-BTqoNOuZ.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CK_IA37Z.js → menuInfo.vue_vue_type_style_index_0_lang-CHco0XcS.js} +1 -1
- package/dist/{pda-app-BTsz1e9J.js → pda-app-BzzynCVk.js} +1 -1
- package/dist/{resource-CRLHuOfC.js → resource-CJQV7_75.js} +1 -1
- package/dist/{su-welcome-CBdJlKhI.js → su-welcome-BxQYF4Ou.js} +1 -1
- package/dist/{sys-config-M3ZUrG9m.js → sys-config-DNFqTmvL.js} +62 -47
- package/dist/udp-core.css +1 -1
- package/package.json +3 -3
- package/src/components/udp/grid/index.vue +524 -514
- package/src/components/udp/utils.ts +2 -2
- package/src/layout/components/lay-sidebar/horizontal.vue +4 -1
- package/src/layout/components/lay-sidebar/mixNav.vue +260 -260
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +3 -3
- package/src/main.ts +17 -17
- package/src/plugins/i18n/zh.ts +362 -361
- package/src/views/system/sys/sys-config.vue +4 -0
- package/src/views/system/sysUser/SysUserPanel.vue +4 -2
- package/dist/index-CrL4X6FE.js +0 -6498
|
@@ -1,514 +1,524 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-17 16:33:37
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-11-
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<template>
|
|
9
|
-
<div style="width: 100%; height: 100%">
|
|
10
|
-
<vxe-grid
|
|
11
|
-
ref="xgrid"
|
|
12
|
-
v-bind="data"
|
|
13
|
-
class="ut-grid-wrapper"
|
|
14
|
-
v-on="attrs.events || {}"
|
|
15
|
-
@toolbarButtonClick="toolbarButtonClick"
|
|
16
|
-
@toolbarToolClick="toolbarButtonClick"
|
|
17
|
-
@cell-click="cellClick"
|
|
18
|
-
@cell-dblclick="cellDbclick"
|
|
19
|
-
@edit-activated="editEctivated"
|
|
20
|
-
@form-reset="onReset"
|
|
21
|
-
/>
|
|
22
|
-
<!-- <SearchScheme
|
|
23
|
-
v-if="showModal && props.url"
|
|
24
|
-
:items="items"
|
|
25
|
-
:view="viewCode"
|
|
26
|
-
@search="onSearch"
|
|
27
|
-
@close="showModal = false"
|
|
28
|
-
/> -->
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script lang="ts" setup>
|
|
33
|
-
// @ts-nocheck
|
|
34
|
-
import { useI18n } from 'vue-i18n';
|
|
35
|
-
import { ref, onBeforeMount, reactive, getCurrentInstance, toRaw, useAttrs, onUnmounted, nextTick } from 'vue';
|
|
36
|
-
import { VxeGridProps } from 'vxe-table';
|
|
37
|
-
import Sortable from 'sortablejs';
|
|
38
|
-
import { clone } from 'xe-utils';
|
|
39
|
-
import { formatGridItems, i18nColums, formatRules, errorMessage, dbstorage, warnMessage } from '@utogether/utils';
|
|
40
|
-
import { http } from '../../../utils/udp/http';
|
|
41
|
-
import {
|
|
42
|
-
queryAll,
|
|
43
|
-
query,
|
|
44
|
-
del,
|
|
45
|
-
save,
|
|
46
|
-
footerSumMethod,
|
|
47
|
-
getToolBarConfig,
|
|
48
|
-
defaultColums,
|
|
49
|
-
onCheckMethod,
|
|
50
|
-
getAttrs
|
|
51
|
-
} from '../utils';
|
|
52
|
-
// import SearchScheme from '../components/SuSearch.vue';
|
|
53
|
-
|
|
54
|
-
defineOptions({
|
|
55
|
-
name: 'UtGrid'
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
export interface IProps {
|
|
59
|
-
checkMethod?: Function;
|
|
60
|
-
serviceCode?: IRecord;
|
|
61
|
-
defaultValue?: IRecord;
|
|
62
|
-
defaultParams?: IRecord;
|
|
63
|
-
url?: string | IRecord;
|
|
64
|
-
columns: Array<ITableColProps>;
|
|
65
|
-
items?: Array<IFormItemProps>;
|
|
66
|
-
editable?: boolean;
|
|
67
|
-
needExport?: boolean; // 是否需要导出
|
|
68
|
-
autoLoad?: boolean; // 自动加载查询数据
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const attrs: IRecord = getAttrs(useAttrs());
|
|
72
|
-
|
|
73
|
-
const kSTORECOLUM = 'U_TABLE_COLUMNN_SORT';
|
|
74
|
-
let storeColums;
|
|
75
|
-
const cacheColumns = {};
|
|
76
|
-
|
|
77
|
-
// console.log(attrs);
|
|
78
|
-
const instance = getCurrentInstance()!;
|
|
79
|
-
const hasAuthority = instance.appContext.config.globalProperties.$hasAuthority;
|
|
80
|
-
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
81
|
-
const viewCode = instance.parent.type.name;
|
|
82
|
-
const $mode = instance.appContext.config.globalProperties.$mode;
|
|
83
|
-
|
|
84
|
-
const props = withDefaults(defineProps<IProps>(), {
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated 2.10.0版本失效,
|
|
87
|
-
* */
|
|
88
|
-
serviceCode: (): IRecord => {
|
|
89
|
-
return {};
|
|
90
|
-
},
|
|
91
|
-
items: () => [],
|
|
92
|
-
columns: () => [],
|
|
93
|
-
editable: true,
|
|
94
|
-
autoLoad: true,
|
|
95
|
-
needExport: true
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const { t } = useI18n();
|
|
99
|
-
|
|
100
|
-
const xgrid = ref(null);
|
|
101
|
-
const showModal = ref(false);
|
|
102
|
-
|
|
103
|
-
const favorite = {
|
|
104
|
-
icon: 'vxe-icon-setting',
|
|
105
|
-
name: 'favorite',
|
|
106
|
-
events: {
|
|
107
|
-
click: (e, option) => {
|
|
108
|
-
if (option.name === 'favorite') {
|
|
109
|
-
showModal.value = true;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @description: 根据items 获取必填选
|
|
117
|
-
*/
|
|
118
|
-
const getRules = () => {
|
|
119
|
-
if (!props.columns.length) return {};
|
|
120
|
-
return formatRules(props.columns, t);
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* @description: colum 统一添加国家化
|
|
124
|
-
*/
|
|
125
|
-
const getColumns = () => {
|
|
126
|
-
const columns = props.columns;
|
|
127
|
-
if (attrs.gridId) {
|
|
128
|
-
const cols = defaultColums
|
|
129
|
-
.filter(f => !columns.some(s => s.field === f.field))
|
|
130
|
-
.map(col => {
|
|
131
|
-
if (attrs.format && ['lastUpdateDate', 'creationDate'].includes(col.field)) {
|
|
132
|
-
col.formatter = attrs.format;
|
|
133
|
-
col.width = 90;
|
|
134
|
-
}
|
|
135
|
-
return col;
|
|
136
|
-
});
|
|
137
|
-
const idx = columns.findIndex(s => s.field === 'operate');
|
|
138
|
-
if (idx !== -1) {
|
|
139
|
-
columns.splice(idx, 0, ...cols);
|
|
140
|
-
} else {
|
|
141
|
-
columns.push(...cols);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const act_columns = attrs.gridId ? formatColums(columns) : columns;
|
|
145
|
-
|
|
146
|
-
return i18nColums(act_columns, attrs.sortable);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
dbstorage.getItem(kSTORECOLUM).then(value => {
|
|
150
|
-
storeColums = value;
|
|
151
|
-
data.columns = getColumns();
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
const data = reactive<VxeGridProps>({
|
|
155
|
-
border: true,
|
|
156
|
-
pagerConfig: { pageSize: attrs.pageSize || 20 },
|
|
157
|
-
editConfig: {},
|
|
158
|
-
editRules: getRules(),
|
|
159
|
-
formConfig: {},
|
|
160
|
-
columnConfig: { useKey: true },
|
|
161
|
-
toolbarConfig: { enabled: false },
|
|
162
|
-
sortConfig: { multiple: true, trigger: 'cell' },
|
|
163
|
-
height: $mode ? undefined : window.innerHeight - 92,
|
|
164
|
-
|
|
165
|
-
checkboxConfig: {
|
|
166
|
-
checkMethod: ({ row }) => onCheckMethod(row, props),
|
|
167
|
-
checkRowKeys: props.checkRowKeys
|
|
168
|
-
},
|
|
169
|
-
loading: false,
|
|
170
|
-
footerRowClassName: 'ut-grid-footer',
|
|
171
|
-
proxyConfig: {
|
|
172
|
-
form: true, // 查询是需要启用表单代理
|
|
173
|
-
autoLoad: props.autoLoad,
|
|
174
|
-
showResponseMsgvxe: false,
|
|
175
|
-
showActionMsgvxe: false,
|
|
176
|
-
// 接收 Promise
|
|
177
|
-
ajax: {
|
|
178
|
-
queryAll: ({ form }) => queryAll(props, serviceApi, form),
|
|
179
|
-
query: ({ page, form, code }) =>
|
|
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
|
-
|
|
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
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
warnMessage(t('message.tip_selectedRecord'));
|
|
312
|
-
return
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
console.log(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
//
|
|
381
|
-
const
|
|
382
|
-
const
|
|
383
|
-
//
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
});
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-17 16:33:37
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-11-18 15:18:53
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<div style="width: 100%; height: 100%">
|
|
10
|
+
<vxe-grid
|
|
11
|
+
ref="xgrid"
|
|
12
|
+
v-bind="data"
|
|
13
|
+
class="ut-grid-wrapper"
|
|
14
|
+
v-on="attrs.events || {}"
|
|
15
|
+
@toolbarButtonClick="toolbarButtonClick"
|
|
16
|
+
@toolbarToolClick="toolbarButtonClick"
|
|
17
|
+
@cell-click="cellClick"
|
|
18
|
+
@cell-dblclick="cellDbclick"
|
|
19
|
+
@edit-activated="editEctivated"
|
|
20
|
+
@form-reset="onReset"
|
|
21
|
+
/>
|
|
22
|
+
<!-- <SearchScheme
|
|
23
|
+
v-if="showModal && props.url"
|
|
24
|
+
:items="items"
|
|
25
|
+
:view="viewCode"
|
|
26
|
+
@search="onSearch"
|
|
27
|
+
@close="showModal = false"
|
|
28
|
+
/> -->
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
// @ts-nocheck
|
|
34
|
+
import { useI18n } from 'vue-i18n';
|
|
35
|
+
import { ref, onBeforeMount, reactive, getCurrentInstance, toRaw, useAttrs, onUnmounted, nextTick } from 'vue';
|
|
36
|
+
import { VxeGridProps } from 'vxe-table';
|
|
37
|
+
import Sortable from 'sortablejs';
|
|
38
|
+
import { clone } from 'xe-utils';
|
|
39
|
+
import { formatGridItems, i18nColums, formatRules, errorMessage, dbstorage, warnMessage } from '@utogether/utils';
|
|
40
|
+
// import { http } from '../../../utils/udp/http';
|
|
41
|
+
import {
|
|
42
|
+
queryAll,
|
|
43
|
+
query,
|
|
44
|
+
del,
|
|
45
|
+
save,
|
|
46
|
+
footerSumMethod,
|
|
47
|
+
getToolBarConfig,
|
|
48
|
+
defaultColums,
|
|
49
|
+
onCheckMethod,
|
|
50
|
+
getAttrs
|
|
51
|
+
} from '../utils';
|
|
52
|
+
// import SearchScheme from '../components/SuSearch.vue';
|
|
53
|
+
|
|
54
|
+
defineOptions({
|
|
55
|
+
name: 'UtGrid'
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export interface IProps {
|
|
59
|
+
checkMethod?: Function;
|
|
60
|
+
serviceCode?: IRecord;
|
|
61
|
+
defaultValue?: IRecord;
|
|
62
|
+
defaultParams?: IRecord;
|
|
63
|
+
url?: string | IRecord;
|
|
64
|
+
columns: Array<ITableColProps>;
|
|
65
|
+
items?: Array<IFormItemProps>;
|
|
66
|
+
editable?: boolean;
|
|
67
|
+
needExport?: boolean; // 是否需要导出
|
|
68
|
+
autoLoad?: boolean; // 自动加载查询数据
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const attrs: IRecord = getAttrs(useAttrs());
|
|
72
|
+
|
|
73
|
+
const kSTORECOLUM = 'U_TABLE_COLUMNN_SORT';
|
|
74
|
+
let storeColums;
|
|
75
|
+
const cacheColumns = {};
|
|
76
|
+
|
|
77
|
+
// console.log(attrs);
|
|
78
|
+
const instance = getCurrentInstance()!;
|
|
79
|
+
const hasAuthority = instance.appContext.config.globalProperties.$hasAuthority;
|
|
80
|
+
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
81
|
+
const viewCode = instance.parent.type.name;
|
|
82
|
+
const $mode = instance.appContext.config.globalProperties.$mode;
|
|
83
|
+
|
|
84
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated 2.10.0版本失效,
|
|
87
|
+
* */
|
|
88
|
+
serviceCode: (): IRecord => {
|
|
89
|
+
return {};
|
|
90
|
+
},
|
|
91
|
+
items: () => [],
|
|
92
|
+
columns: () => [],
|
|
93
|
+
editable: true,
|
|
94
|
+
autoLoad: true,
|
|
95
|
+
needExport: true
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const { t } = useI18n();
|
|
99
|
+
|
|
100
|
+
const xgrid = ref(null);
|
|
101
|
+
const showModal = ref(false);
|
|
102
|
+
|
|
103
|
+
const favorite = {
|
|
104
|
+
icon: 'vxe-icon-setting',
|
|
105
|
+
name: 'favorite',
|
|
106
|
+
events: {
|
|
107
|
+
click: (e, option) => {
|
|
108
|
+
if (option.name === 'favorite') {
|
|
109
|
+
showModal.value = true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @description: 根据items 获取必填选
|
|
117
|
+
*/
|
|
118
|
+
const getRules = () => {
|
|
119
|
+
if (!props.columns.length) return {};
|
|
120
|
+
return formatRules(props.columns, t);
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* @description: colum 统一添加国家化
|
|
124
|
+
*/
|
|
125
|
+
const getColumns = () => {
|
|
126
|
+
const columns = props.columns;
|
|
127
|
+
if (attrs.gridId) {
|
|
128
|
+
const cols = defaultColums
|
|
129
|
+
.filter(f => !columns.some(s => s.field === f.field))
|
|
130
|
+
.map(col => {
|
|
131
|
+
if (attrs.format && ['lastUpdateDate', 'creationDate'].includes(col.field)) {
|
|
132
|
+
col.formatter = attrs.format;
|
|
133
|
+
col.width = 90;
|
|
134
|
+
}
|
|
135
|
+
return col;
|
|
136
|
+
});
|
|
137
|
+
const idx = columns.findIndex(s => s.field === 'operate');
|
|
138
|
+
if (idx !== -1) {
|
|
139
|
+
columns.splice(idx, 0, ...cols);
|
|
140
|
+
} else {
|
|
141
|
+
columns.push(...cols);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const act_columns = attrs.gridId ? formatColums(columns) : columns;
|
|
145
|
+
|
|
146
|
+
return i18nColums(act_columns, attrs.sortable);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
dbstorage.getItem(kSTORECOLUM).then(value => {
|
|
150
|
+
storeColums = value;
|
|
151
|
+
data.columns = getColumns();
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const data = reactive<VxeGridProps>({
|
|
155
|
+
border: true,
|
|
156
|
+
pagerConfig: { pageSize: attrs.pageSize || 20 },
|
|
157
|
+
editConfig: {},
|
|
158
|
+
editRules: getRules(),
|
|
159
|
+
formConfig: {},
|
|
160
|
+
columnConfig: { useKey: true },
|
|
161
|
+
toolbarConfig: { enabled: false },
|
|
162
|
+
sortConfig: { multiple: true, trigger: 'cell' },
|
|
163
|
+
height: $mode ? undefined : window.innerHeight - 92,
|
|
164
|
+
|
|
165
|
+
checkboxConfig: {
|
|
166
|
+
checkMethod: ({ row }) => onCheckMethod(row, props),
|
|
167
|
+
checkRowKeys: props.checkRowKeys
|
|
168
|
+
},
|
|
169
|
+
loading: false,
|
|
170
|
+
footerRowClassName: 'ut-grid-footer',
|
|
171
|
+
proxyConfig: {
|
|
172
|
+
form: true, // 查询是需要启用表单代理
|
|
173
|
+
autoLoad: props.autoLoad,
|
|
174
|
+
showResponseMsgvxe: false,
|
|
175
|
+
showActionMsgvxe: false,
|
|
176
|
+
// 接收 Promise
|
|
177
|
+
ajax: {
|
|
178
|
+
queryAll: ({ form }) => queryAll(props, serviceApi, form),
|
|
179
|
+
query: ({ page, form, code }) => {
|
|
180
|
+
debugger;
|
|
181
|
+
return query(props, form, page, serviceApi, code, $mode);
|
|
182
|
+
},
|
|
183
|
+
delete: ({ body: { removeRecords } }) => del(serviceApi, removeRecords, props),
|
|
184
|
+
save: ({ body }) => Promise.all(save(serviceApi, body, props)),
|
|
185
|
+
querySuccess: ({ response }) => callback('querySuccess', response),
|
|
186
|
+
queryError: ({ response }) => callback('queryError', response),
|
|
187
|
+
deleteSuccess: ({ response }) => callback('deleteSuccess', response),
|
|
188
|
+
deleteError: ({ response }) => callback('deleteError', response),
|
|
189
|
+
saveSuccess: ({ response }) => callback('saveSuccess', response),
|
|
190
|
+
saveError: ({ response }) => callback('saveError', response)
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
columns: !attrs.gridId ? getColumns() : [],
|
|
194
|
+
...attrs
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @description: 预处理查询form
|
|
199
|
+
* @return {*} items
|
|
200
|
+
*/
|
|
201
|
+
const getItems = () => {
|
|
202
|
+
if (!props.items.length) return props.items;
|
|
203
|
+
return formatGridItems(clone(props.items, true), viewCode && props.url ? favorite : viewCode);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @description 格式化column
|
|
208
|
+
* @return {*} columns
|
|
209
|
+
*/
|
|
210
|
+
function formatColums(columns) {
|
|
211
|
+
const customSort = storeColums ? storeColums[attrs.gridId] : {};
|
|
212
|
+
if (!customSort) return columns;
|
|
213
|
+
return columns
|
|
214
|
+
.map((col, idx) => {
|
|
215
|
+
const sort = (idx + 1) * 10;
|
|
216
|
+
col._sort = customSort[col.field] || sort;
|
|
217
|
+
// 缓存列索引数据
|
|
218
|
+
cacheColumns[col.field] = col._sort;
|
|
219
|
+
return col;
|
|
220
|
+
})
|
|
221
|
+
.sort((a, b) => a._sort - b._sort);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @description: 设置grid参数
|
|
226
|
+
*/
|
|
227
|
+
const setGridConfig = () => {
|
|
228
|
+
// 查询
|
|
229
|
+
if (props.items.length) {
|
|
230
|
+
// data.formConfig = {};
|
|
231
|
+
data.formConfig = {
|
|
232
|
+
titleWidth: 100,
|
|
233
|
+
titleAlign: 'right',
|
|
234
|
+
items: getItems(),
|
|
235
|
+
rules: formatRules(props.items, t),
|
|
236
|
+
validConfig: { showMessage: false }
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
// tool bar
|
|
240
|
+
const obj = getToolBarConfig(data, props, attrs, hasAuthority);
|
|
241
|
+
Object.assign(data, obj);
|
|
242
|
+
// 表格id,用于自定义列
|
|
243
|
+
if (attrs.gridId) {
|
|
244
|
+
data.id = attrs.gridId;
|
|
245
|
+
data.customConfig = {
|
|
246
|
+
storage: true,
|
|
247
|
+
mode: 'popup',
|
|
248
|
+
checkMethod({ column }) {
|
|
249
|
+
return column.field === 'operate' || ['checkbox', 'radio'].includes(column.type) ? false : true;
|
|
250
|
+
},
|
|
251
|
+
modalOptions: {
|
|
252
|
+
width: 750,
|
|
253
|
+
height: '75%'
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
if (attrs.mergeFooter) {
|
|
258
|
+
// 合计方法
|
|
259
|
+
data.showFooter = true;
|
|
260
|
+
data.footerMethod = ({ columns, data }) => footerSumMethod({ columns, data }, attrs.mergeFooter);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* @description 手动调用查询方法
|
|
265
|
+
*/
|
|
266
|
+
const refreshData = () => {
|
|
267
|
+
xgrid.value.commitProxy('query');
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* @description 刷新列数据
|
|
271
|
+
*/
|
|
272
|
+
const refreshColumn = () => {
|
|
273
|
+
data.editRules = getRules();
|
|
274
|
+
return xgrid.value.refreshColumn();
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* @description 显示加载框
|
|
278
|
+
*/
|
|
279
|
+
const showLoading = () => {
|
|
280
|
+
data.loading = true;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* @description 隐藏加载框
|
|
284
|
+
*/
|
|
285
|
+
const hiddenLoading = () => {
|
|
286
|
+
data.loading = false;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* @description 获取实例方法
|
|
290
|
+
* @return vxe-grid实例的方法
|
|
291
|
+
*/
|
|
292
|
+
const getInstance = () => {
|
|
293
|
+
return toRaw(xgrid.value);
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* @description 获取表格全量数据方法
|
|
297
|
+
* @return vxe-grid表格全量数据
|
|
298
|
+
*/
|
|
299
|
+
const getTableData = () => {
|
|
300
|
+
return xgrid.value.getTableData().fullData;
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* @description 获取表格选中的行
|
|
304
|
+
* @return vxe-grid表格勾选行
|
|
305
|
+
*/
|
|
306
|
+
const getSelectRecords = (isFull = false) => {
|
|
307
|
+
const columnType = props.columns[0].type;
|
|
308
|
+
const checkRecords =
|
|
309
|
+
columnType === 'radio' ? xgrid.value.getRadioRecord(isFull) : xgrid.value.getCheckboxRecords(isFull);
|
|
310
|
+
if (columnType === 'checkbox' && !checkRecords.length) {
|
|
311
|
+
warnMessage(t('message.tip_selectedRecord'));
|
|
312
|
+
return [];
|
|
313
|
+
} else if (columnType === 'radio' && !checkRecords) {
|
|
314
|
+
warnMessage(t('message.tip_selectedRecord'));
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
return checkRecords;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
const callback = (cb, response) => {
|
|
321
|
+
attrs?.callback && attrs?.callback[cb] && attrs?.callback[cb](response);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
const onReset = async e => {
|
|
325
|
+
console.log(e);
|
|
326
|
+
const data = e.data;
|
|
327
|
+
const items = props.items.filter(f => f.itemRender?.props?.multiple);
|
|
328
|
+
console.log(items);
|
|
329
|
+
items.forEach(item => {
|
|
330
|
+
if (item.itemRender.props.defaultValue) {
|
|
331
|
+
data[`_${item.field}`] = item.itemRender.props.defaultValue.split(',');
|
|
332
|
+
data[`${item.field}`] = item.itemRender.props.defaultValue;
|
|
333
|
+
} else {
|
|
334
|
+
data[`_${item.field}`] = [];
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
if (items.length) {
|
|
338
|
+
// 多选时,重新查询一次
|
|
339
|
+
setTimeout(() => {
|
|
340
|
+
refreshData();
|
|
341
|
+
}, 200);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
let sortable2: any;
|
|
346
|
+
const columnDrop = () => {
|
|
347
|
+
const $grid = xgrid.value;
|
|
348
|
+
sortable2 = Sortable.create($grid.$el.querySelector('.vxe-table--header .vxe-header--row'), {
|
|
349
|
+
disabled: !attrs.gridId,
|
|
350
|
+
handle: '.vxe-header--column',
|
|
351
|
+
onEnd: async sortableEvent => {
|
|
352
|
+
const targetThElem = sortableEvent.item;
|
|
353
|
+
const newIndex = sortableEvent.newIndex as number;
|
|
354
|
+
const oldIndex = sortableEvent.oldIndex as number;
|
|
355
|
+
const { fullColumn, tableColumn } = $grid.getTableColumn();
|
|
356
|
+
const wrapperElem = targetThElem.parentNode as HTMLElement;
|
|
357
|
+
const newColumn = fullColumn[newIndex];
|
|
358
|
+
const item = fullColumn[oldIndex];
|
|
359
|
+
let nodrag = false;
|
|
360
|
+
let msg = '固定列';
|
|
361
|
+
if (newColumn.fixed) {
|
|
362
|
+
nodrag = false;
|
|
363
|
+
} else if (newIndex === 0 || ['checkbox', 'radio'].includes(item.type)) {
|
|
364
|
+
msg = '勾选列';
|
|
365
|
+
nodrag = true;
|
|
366
|
+
} else if (item.field === 'operate' || newIndex === fullColumn.length - 1) {
|
|
367
|
+
nodrag = true;
|
|
368
|
+
msg = '操作列';
|
|
369
|
+
}
|
|
370
|
+
if (nodrag) {
|
|
371
|
+
// 错误的移动
|
|
372
|
+
const oldThElem = wrapperElem.children[oldIndex] as HTMLElement;
|
|
373
|
+
if (newIndex > oldIndex) {
|
|
374
|
+
wrapperElem.insertBefore(targetThElem, oldThElem);
|
|
375
|
+
} else {
|
|
376
|
+
wrapperElem.insertBefore(targetThElem, oldThElem ? oldThElem.nextElementSibling : oldThElem);
|
|
377
|
+
}
|
|
378
|
+
return errorMessage(msg + '不允许拖动!');
|
|
379
|
+
}
|
|
380
|
+
// 获取列索引 columnIndex > fullColumn
|
|
381
|
+
const oldColumnIndex = $grid.getColumnIndex(tableColumn[oldIndex]);
|
|
382
|
+
const newColumnIndex = $grid.getColumnIndex(tableColumn[newIndex]);
|
|
383
|
+
// 移动到目标列
|
|
384
|
+
const currRow = fullColumn.splice(oldColumnIndex, 1)[0];
|
|
385
|
+
fullColumn.splice(newColumnIndex, 0, currRow);
|
|
386
|
+
|
|
387
|
+
// 拖拽方向 1: 右 -1: 左
|
|
388
|
+
const direction = newColumnIndex - oldColumnIndex > 0 ? 1 : -1;
|
|
389
|
+
|
|
390
|
+
// 获取新列
|
|
391
|
+
const newSort = (newColumnIndex + 1) * 10;
|
|
392
|
+
const oldSort = (oldColumnIndex + 1) * 10;
|
|
393
|
+
// 目标列索引+1,方便后续计算
|
|
394
|
+
const comparisonVal = newSort + 1 * direction;
|
|
395
|
+
for (const key in cacheColumns) {
|
|
396
|
+
const cacheValue = cacheColumns[key];
|
|
397
|
+
if (direction > 0 && cacheValue < comparisonVal && cacheValue > oldSort) {
|
|
398
|
+
// 大于拖拽列且小于目标列的索引,均向前移动一个单位
|
|
399
|
+
cacheColumns[key] = cacheValue - 10 * direction;
|
|
400
|
+
} else if (direction < 0 && cacheValue > comparisonVal && cacheValue < oldSort) {
|
|
401
|
+
// 小于拖拽列且大于目标列的索引, 均向后移动一个单位
|
|
402
|
+
cacheColumns[key] = cacheValue - 10 * direction;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
cacheColumns[currRow.field] = newSort;
|
|
407
|
+
|
|
408
|
+
dbstorage.setItem(kSTORECOLUM, { [attrs.gridId]: cacheColumns });
|
|
409
|
+
$grid.loadColumn(fullColumn);
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* @description 常用查询面板确认查询
|
|
416
|
+
* @param data 常用查询条件
|
|
417
|
+
*/
|
|
418
|
+
// const onSearch = data => {
|
|
419
|
+
// showModal.value = false;
|
|
420
|
+
// const { form } = xgrid.value.getProxyInfo();
|
|
421
|
+
// Object.assign(form, data);
|
|
422
|
+
// refreshData();
|
|
423
|
+
// };
|
|
424
|
+
|
|
425
|
+
const reloadGrid = () => {
|
|
426
|
+
setGridConfig();
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @description Vue实例对外暴露的相关方法或属性
|
|
431
|
+
*/
|
|
432
|
+
defineExpose({
|
|
433
|
+
getTableData,
|
|
434
|
+
getSelectRecords,
|
|
435
|
+
refreshData,
|
|
436
|
+
refreshColumn,
|
|
437
|
+
getInstance,
|
|
438
|
+
showLoading,
|
|
439
|
+
hiddenLoading,
|
|
440
|
+
reloadGrid
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
const toolbarButtonClick = ({ code }) => {
|
|
444
|
+
emit('buttonClick', code);
|
|
445
|
+
};
|
|
446
|
+
const cellClick = e => {
|
|
447
|
+
emit('cellClick', e);
|
|
448
|
+
};
|
|
449
|
+
const cellDbclick = e => {
|
|
450
|
+
emit('cellDbclick', e);
|
|
451
|
+
};
|
|
452
|
+
const editEctivated = e => {
|
|
453
|
+
emit('editEctivated', e);
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* @description: 监听窗口变化,动态改变表格的高度
|
|
458
|
+
*/
|
|
459
|
+
const addResizeListener = () => {
|
|
460
|
+
window.onresize = () => {
|
|
461
|
+
return (() => {
|
|
462
|
+
let height = attrs?.height || window.innerHeight - 90;
|
|
463
|
+
if (attrs.mode !== 'inline' && !attrs?.height) {
|
|
464
|
+
height = window.innerHeight - 180;
|
|
465
|
+
}
|
|
466
|
+
data.height = height < 240 ? 240 : height;
|
|
467
|
+
})();
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
let initTime: any;
|
|
472
|
+
nextTick(() => {
|
|
473
|
+
// 加载完成之后在绑定拖动事件
|
|
474
|
+
initTime = setTimeout(() => {
|
|
475
|
+
columnDrop();
|
|
476
|
+
}, 500);
|
|
477
|
+
});
|
|
478
|
+
/**
|
|
479
|
+
* @description Vue实例卸载
|
|
480
|
+
*/
|
|
481
|
+
onUnmounted(() => {
|
|
482
|
+
clearTimeout(initTime);
|
|
483
|
+
sortable2 && sortable2.destroy();
|
|
484
|
+
});
|
|
485
|
+
/**
|
|
486
|
+
* @description Vue实例挂载
|
|
487
|
+
*/
|
|
488
|
+
onBeforeMount(() => {
|
|
489
|
+
setGridConfig();
|
|
490
|
+
addResizeListener();
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
const emit = defineEmits<{
|
|
494
|
+
(e: 'buttonClick', code: string): void;
|
|
495
|
+
(e: 'cellClick', data: any): void;
|
|
496
|
+
(e: 'cellDbclick', data: any): void;
|
|
497
|
+
(e: 'editEctivated', data: any): void;
|
|
498
|
+
}>();
|
|
499
|
+
</script>
|
|
500
|
+
|
|
501
|
+
<style lang="scss">
|
|
502
|
+
.ut-grid-wrapper {
|
|
503
|
+
padding: 5px;
|
|
504
|
+
background-color: #fff;
|
|
505
|
+
|
|
506
|
+
.vxe-form--item {
|
|
507
|
+
padding: 0.1em 0.8em 0.1em 0 !important;
|
|
508
|
+
|
|
509
|
+
.el-select {
|
|
510
|
+
.el-input {
|
|
511
|
+
height: 26px;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.el-select__tags-text {
|
|
515
|
+
color: #000;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.vxe-grid--layout-body-content-wrapper {
|
|
521
|
+
overflow: hidden;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
</style>
|