@utogether/udp-core 1.0.1-beta.2 → 1.0.1-beta.4

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.
Files changed (98) hide show
  1. package/build/plugins.ts +6 -1
  2. package/dist/{403-BBQoJwTM.js → 403-CT4J-t-o.js} +1 -1
  3. package/dist/{404-BbJPSIWM.js → 404-BAudfnaK.js} +1 -1
  4. package/dist/{500-BtFL9R4M.js → 500-BlOGtpEE.js} +1 -1
  5. package/dist/{AuthorityInfo-DhiwCeLN.js → AuthorityInfo-Bl03tEhF.js} +1 -1
  6. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-Duyweh89.js → AuthorityInfo.vue_vue_type_style_index_0_lang-CUwS2F3R.js} +1 -1
  7. package/dist/{Company-CGqmslx-.js → Company-CIj9XgQn.js} +3 -3
  8. package/dist/{CompanyPanel-hlDsxD-6.js → CompanyPanel-CublK5NN.js} +16 -16
  9. package/dist/{Department-BZyJtacc.js → Department-BolPW-W3.js} +3 -3
  10. package/dist/{DepartmentPanel-D-a_EBFt.js → DepartmentPanel-BttxSHfM.js} +1 -1
  11. package/dist/{DesignPanel-Bl4luWDV.js → DesignPanel-BwCbn92O.js} +1 -1
  12. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-I8C3iGvz.js → DesignPanel.vue_vue_type_style_index_0_lang-y2AnCTg6.js} +2 -2
  13. package/dist/{DictView-B4a7Hs1X.js → DictView-D85ziNV2.js} +13 -12
  14. package/dist/InvOrganization-CaAk_f7F.js +66 -0
  15. package/dist/{Org-BTGTrAVz.js → Org-CreIihFE.js} +1 -1
  16. package/dist/{Preview-pHD84xqI.js → Preview-DMGbhV6q.js} +1 -1
  17. package/dist/{ReportDefine-DnnCNQWS.js → ReportDefine-DogZwa8T.js} +1 -1
  18. package/dist/{ReportDesign-BnI_Q4pg.js → ReportDesign-CdSsJJeA.js} +2 -2
  19. package/dist/{ReportQuery-Dby2MmtM.js → ReportQuery-DPvKqeUm.js} +1 -1
  20. package/dist/{ReportQueryFrom-Blm1N8P1.js → ReportQueryFrom-UokkfBx_.js} +1 -1
  21. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CnG_Ybnt.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-BlOoThY7.js} +1 -1
  22. package/dist/{ReportTemplate-D65RXRY_.js → ReportTemplate-DCnmllXW.js} +1 -1
  23. package/dist/{Role-eFZoTpXc.js → Role-sfmwLiNM.js} +3 -3
  24. package/dist/{RoleAssign-D9-Y3UNz.js → RoleAssign-WRk90VO2.js} +3 -3
  25. package/dist/{RolePanel-DlFw6HSf.js → RolePanel-DhP0_5ur.js} +1 -1
  26. package/dist/{RolePanel-CoUOc3sX.js → RolePanel-iWysS02n.js} +1 -1
  27. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DKHgNWQP.js → RolePanel.vue_vue_type_script_setup_true_lang-CYXqW-d4.js} +1 -1
  28. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Clwk-MHw.js → RolePanel.vue_vue_type_script_setup_true_lang-_hVY31HC.js} +3 -3
  29. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-M2FQJwPU.js → ScrollPanel.vue_vue_type_style_index_0_lang-BozDFES-.js} +1 -1
  30. package/dist/{Staff-DFBLCsAd.js → Staff-Bha-Ijax.js} +3 -3
  31. package/dist/{StaffInfo-d2CK0oBA.js → StaffInfo-CbfYI8UW.js} +1 -1
  32. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-4m8wK9tq.js → StaffInfo.vue_vue_type_script_setup_true_lang-Ce-MUVYH.js} +1 -1
  33. package/dist/{StaffPanel-D6aWLKN3.js → StaffPanel-B8094e97.js} +1 -1
  34. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-C7YT2CVb.js → StaffPanel.vue_vue_type_script_setup_true_lang-_kJIBCtx.js} +2 -2
  35. package/dist/{SysUser-BdZvYxQH.js → SysUser-D1J9vPnb.js} +2 -2
  36. package/dist/{SysUserPanel-BIVa6LLr.js → SysUserPanel-DGDPKKoY.js} +1 -1
  37. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-BsBKpYR7.js → SysUserPanel.vue_vue_type_script_setup_true_lang-D-5-zKn6.js} +1 -1
  38. package/dist/{SystemMenu-C-5VKlHK.js → SystemMenu-Dz8Pllh5.js} +9 -9
  39. package/dist/{UserInfo-DqXCRZts.js → UserInfo-ecAJA2Yg.js} +1 -1
  40. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-N3TwfpPx.js → UserInfo.vue_vue_type_style_index_0_lang-4_-I_sQN.js} +1 -1
  41. package/dist/{childView-B2lSsqS3.js → childView-4uI_RT2m.js} +1 -1
  42. package/dist/{childView-DRUNqgjI.js → childView-OXXoMFg3.js} +1 -1
  43. package/dist/{childView.vue_vue_type_style_index_0_lang-oGriyFTv.js → childView.vue_vue_type_style_index_0_lang-DC-yx4Kv.js} +1 -1
  44. package/dist/{childView.vue_vue_type_style_index_0_lang-B9XBDDU_.js → childView.vue_vue_type_style_index_0_lang-e43PUsUO.js} +1 -1
  45. package/dist/{code-rule-DZC9T6cl.js → code-rule-B667R66s.js} +1 -1
  46. package/dist/core.es.js +14 -11
  47. package/dist/{cron-task-BJwPeA5F.js → cron-task-DcmGSr2D.js} +1 -1
  48. package/dist/{frameView-C6wkvok-.js → frameView-BzgaLYjQ.js} +1 -1
  49. package/dist/img/l_img.svg +1 -1
  50. package/dist/img/minicolors.png +0 -0
  51. package/dist/img/v_img.svg +1 -1
  52. package/dist/{index-DZc3qRTx.js → index-CLliRySq.js} +516 -560
  53. package/dist/{layoutView-CeJBpZb_.js → layoutView-BBQB8pDc.js} +109 -108
  54. package/dist/{login-BOxwzwdB.js → login-DIG7pRU7.js} +2 -2
  55. package/dist/{lov-view-DRF-99U4.js → lov-view-CSIPKZSY.js} +2 -2
  56. package/dist/{menuInfo-3Sjvs9nM.js → menuInfo-CPHjl7id.js} +1 -1
  57. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-DrQ560nm.js → menuInfo.vue_vue_type_style_index_0_lang-BXNiinTg.js} +31 -29
  58. package/dist/{pda-app-B9tn7jdv.js → pda-app-BLjbMcdt.js} +1 -1
  59. package/dist/{resource-BqnxbQNe.js → resource-MxqaSJqB.js} +1 -1
  60. package/dist/{su-welcome-VwifUK_O.js → su-welcome-C0flTYCx.js} +1 -1
  61. package/dist/{sys-config-C0-gSBFO.js → sys-config-CXzGs3Nl.js} +1 -1
  62. package/dist/udp-core.css +2 -2
  63. package/dist/{utogether-Di1byIum.js → utogether-CFdIDuAT.js} +1 -1
  64. package/index.ts +40 -36
  65. package/package.json +1 -1
  66. package/src/App.vue +70 -70
  67. package/src/components/udp/grid.vue +505 -0
  68. package/src/components/udp/index.ts +7 -4
  69. package/src/components/udp/lov.vue +410 -0
  70. package/src/components/udp/modal-form.vue +2 -2
  71. package/src/components/udp/modal-grid.vue +297 -0
  72. package/src/components/udp/utils.ts +379 -40
  73. package/src/directives/permission/index.ts +1 -1
  74. package/src/layout/components/lay-navbar/index.vue +1 -1
  75. package/src/layout/components/lay-panel/index.vue +150 -150
  76. package/src/layout/components/lay-sidebar/breadCrumb.vue +1 -1
  77. package/src/layout/components/lay-tag/index.vue +625 -625
  78. package/src/layout/layoutView.vue +215 -215
  79. package/src/main.ts +7 -6
  80. package/src/plugins/i18n/en.ts +291 -289
  81. package/src/plugins/i18n/zh.ts +338 -337
  82. package/src/plugins/vxe-table/index.ts +1 -1
  83. package/src/plugins/vxe-table/render.tsx +4 -2
  84. package/src/router/index.ts +187 -183
  85. package/src/router/modules/remaining.ts +58 -83
  86. package/src/style/button.scss +85 -78
  87. package/src/style/tailwind.css +1 -68
  88. package/src/style/vxetable.scss +265 -256
  89. package/src/utils/authority/index.ts +1 -1
  90. package/src/views/organization/company/CompanyPanel.vue +259 -259
  91. package/src/views/organization/inv-org/InvOrganization.vue +2 -3
  92. package/src/views/system/menu/SystemMenu.vue +1 -1
  93. package/src/views/system/menu/menuInfo.vue +376 -373
  94. package/src/views/udev/dict/DictView.vue +106 -106
  95. package/src/views/udev/lov/lov-view.vue +91 -91
  96. package/types/global.d.ts +2 -1
  97. package/vite.config.ts +4 -1
  98. package/dist/InvOrganization-q4T3y8dQ.js +0 -260
@@ -0,0 +1,505 @@
1
+ <!--
2
+ * @Author: wei.li
3
+ * @Date: 2021-11-17 16:33:37
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-07-23 10:21:02
6
+ * @Description: file content
7
+ -->
8
+ <template>
9
+ <div style="width: 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
+ />
21
+ <!-- <SearchScheme
22
+ v-if="showModal && props.url"
23
+ :items="items"
24
+ :view="viewCode"
25
+ @search="onSearch"
26
+ @close="showModal = false"
27
+ /> -->
28
+ </div>
29
+ </template>
30
+
31
+ <script lang="ts" setup>
32
+ // @ts-nocheck
33
+ import { useI18n } from 'vue-i18n';
34
+ import {
35
+ ref,
36
+ onBeforeMount,
37
+ reactive,
38
+ getCurrentInstance,
39
+ toRaw,
40
+ useAttrs,
41
+ onUnmounted,
42
+ nextTick
43
+ } from 'vue';
44
+ import { VxeGridProps } from 'vxe-table';
45
+ import Sortable from 'sortablejs';
46
+ import { clone } from 'xe-utils';
47
+ import {
48
+ formatGridItems,
49
+ i18nColums,
50
+ formatRules,
51
+ errorMessage,
52
+ dbstorage,
53
+ warnMessage
54
+ } from '@utogether/utils';
55
+ import {
56
+ queryAll,
57
+ query,
58
+ del,
59
+ save,
60
+ footerSumMethod,
61
+ getToolBarConfig,
62
+ defaultColums,
63
+ onCheckMethod,
64
+ getAttrs
65
+ } from './utils';
66
+ // import SearchScheme from '../components/SuSearch.vue';
67
+ // import type { IRecord, IFormItemProps, ITableColProps } from '../../types';
68
+
69
+ defineOptions({
70
+ name: 'UtGrid'
71
+ });
72
+
73
+ export interface IProps {
74
+ checkMethod?: Function;
75
+ serviceCode?: IRecord;
76
+ defaultValue?: IRecord;
77
+ defaultParams?: IRecord;
78
+ url?: string;
79
+ columns: Array<ITableColProps>;
80
+ items?: Array<IFormItemProps>;
81
+ editable?: boolean;
82
+ needExport?: boolean; // 是否需要导出
83
+ autoLoad?: boolean; // 自动加载查询数据
84
+ }
85
+
86
+ const attrs: IRecord = getAttrs(useAttrs());
87
+
88
+ const kSTORECOLUM = 'U_TABLE_COLUMNN_SORT';
89
+ let storeColums;
90
+ const cacheColumns = {};
91
+
92
+ // console.log(attrs);
93
+ const instance = getCurrentInstance()!;
94
+ const hasAuthority = instance.appContext.config.globalProperties.$hasAuthority;
95
+ const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
96
+ const viewCode = instance.parent.type.name;
97
+ const $mode = instance.appContext.config.globalProperties.$mode;
98
+
99
+ const props = withDefaults(defineProps<IProps>(), {
100
+ /**
101
+ * @deprecated 2.10.0版本失效,
102
+ * */
103
+ serviceCode: (): IRecord => {
104
+ return {};
105
+ },
106
+ items: () => [],
107
+ columns: () => [],
108
+ editable: true,
109
+ autoLoad: true,
110
+ needExport: true
111
+ });
112
+
113
+ const { t } = useI18n();
114
+
115
+ const xgrid = ref(null);
116
+ const showModal = ref(false);
117
+
118
+ const favorite = {
119
+ icon: 'vxe-icon-setting',
120
+ name: 'favorite',
121
+ events: {
122
+ click: (e, option) => {
123
+ if (option.name === 'favorite') {
124
+ showModal.value = true;
125
+ }
126
+ }
127
+ }
128
+ };
129
+
130
+ /**
131
+ * @description: 根据items 获取必填选
132
+ */
133
+ const getRules = () => {
134
+ if (!props.columns.length) return {};
135
+ return formatRules(props.columns, t);
136
+ };
137
+ /**
138
+ * @description: colum 统一添加国家化
139
+ */
140
+ const getColumns = () => {
141
+ const columns = props.columns;
142
+ if (attrs.gridId) {
143
+ const cols = defaultColums
144
+ .filter(f => !columns.some(s => s.field === f.field))
145
+ .map(col => {
146
+ if (attrs.format && ['lastUpdateDate', 'creationDate'].includes(col.field)) {
147
+ col.formatter = attrs.format;
148
+ col.width = 90;
149
+ }
150
+ return col;
151
+ });
152
+ const idx = columns.findIndex(s => s.field === 'operate');
153
+ if (idx !== -1) {
154
+ columns.splice(idx, 0, ...cols);
155
+ } else {
156
+ columns.push(...cols);
157
+ }
158
+ }
159
+ const act_columns = attrs.gridId ? formatColums(columns) : columns;
160
+
161
+ return i18nColums(act_columns);
162
+ };
163
+
164
+ dbstorage.getItem(kSTORECOLUM).then(value => {
165
+ storeColums = value;
166
+ data.columns = getColumns();
167
+ });
168
+
169
+ const data = reactive<VxeGridProps>({
170
+ border: true,
171
+ pagerConfig: { pageSize: attrs.pageSize || 20 },
172
+ editConfig: {},
173
+ editRules: getRules(),
174
+ formConfig: {},
175
+ columnConfig: { useKey: true },
176
+ toolbarConfig: { enabled: false },
177
+ sortConfig: { multiple: true, trigger: 'cell' },
178
+ height: $mode ? undefined : window.innerHeight - 90,
179
+
180
+ checkboxConfig: {
181
+ checkMethod: ({ row }) => onCheckMethod(row, props),
182
+ checkRowKeys: props.checkRowKeys
183
+ },
184
+ loading: false,
185
+ footerRowClassName: 'ut-grid-footer',
186
+ proxyConfig: {
187
+ form: true, // 查询是需要启用表单代理
188
+ autoLoad: props.autoLoad,
189
+ // 接收 Promise
190
+ ajax: {
191
+ queryAll: ({ form }) => queryAll(props, serviceApi, form),
192
+ query: ({ page, form }) => query(props, form, page, serviceApi, $mode),
193
+ delete: ({ body: { removeRecords } }) => del(serviceApi, removeRecords, props),
194
+ save: ({ body }) => Promise.all(save(serviceApi, body, props)),
195
+ querySuccess: e => querySuccess(e)
196
+ }
197
+ },
198
+ columns: !attrs.gridId ? getColumns() : [],
199
+ ...attrs
200
+ });
201
+
202
+ /**
203
+ * @description: 预处理查询form
204
+ * @return {*} items
205
+ */
206
+ const getItems = () => {
207
+ if (!props.items.length) return props.items;
208
+ return formatGridItems(clone(props.items, true), viewCode && props.url ? favorite : viewCode);
209
+ };
210
+
211
+ /**
212
+ * @description 格式化column
213
+ * @return {*} columns
214
+ */
215
+ function formatColums(columns) {
216
+ const customSort = storeColums ? storeColums[attrs.gridId] : {};
217
+ if (!customSort) return columns;
218
+ return columns
219
+ .map((col, idx) => {
220
+ const sort = (idx + 1) * 10;
221
+ col._sort = customSort[col.field] || sort;
222
+ // 缓存列索引数据
223
+ cacheColumns[col.field] = col._sort;
224
+ return col;
225
+ })
226
+ .sort((a, b) => a._sort - b._sort);
227
+ }
228
+
229
+ /**
230
+ * @description: 设置grid参数
231
+ */
232
+ const setGridConfig = () => {
233
+ // 查询
234
+ if (props.items.length) {
235
+ // data.formConfig = {};
236
+ data.formConfig = {
237
+ titleWidth: 100,
238
+ titleAlign: 'right',
239
+ items: getItems(),
240
+ rules: formatRules(props.items, t),
241
+ validConfig: { showMessage: false }
242
+ };
243
+ }
244
+ // tool bar
245
+ const obj = getToolBarConfig(data, props, attrs, hasAuthority);
246
+ Object.assign(data, obj);
247
+ // 表格id,用于自定义列
248
+ if (attrs.gridId) {
249
+ data.id = attrs.gridId;
250
+ data.customConfig = {
251
+ storage: true,
252
+ mode: 'popup',
253
+ checkMethod({ column }) {
254
+ return column.field === 'operate' || ['checkbox', 'radio'].includes(column.type) ? false : true;
255
+ },
256
+ modalOptions: {
257
+ width: 750,
258
+ height: '75%'
259
+ }
260
+ };
261
+ }
262
+ if (attrs.mergeFooter) {
263
+ // 合计方法
264
+ data.showFooter = true;
265
+ data.footerMethod = ({ columns, data }) => footerSumMethod({ columns, data }, attrs.mergeFooter);
266
+ }
267
+ };
268
+ /**
269
+ * @description 手动调用查询方法
270
+ */
271
+ const refreshData = () => {
272
+ xgrid.value.commitProxy('query');
273
+ };
274
+ /**
275
+ * @description 刷新列数据
276
+ */
277
+ const refreshColumn = () => {
278
+ data.editRules = getRules();
279
+ return xgrid.value.refreshColumn();
280
+ };
281
+ /**
282
+ * @description 显示加载框
283
+ */
284
+ const showLoading = () => {
285
+ data.loading = true;
286
+ };
287
+ /**
288
+ * @description 隐藏加载框
289
+ */
290
+ const hiddenLoading = () => {
291
+ data.loading = false;
292
+ };
293
+ /**
294
+ * @description 获取实例方法
295
+ * @return vxe-grid实例的方法
296
+ */
297
+ const getInstance = () => {
298
+ return toRaw(xgrid.value);
299
+ };
300
+ /**
301
+ * @description 获取表格全量数据方法
302
+ * @return vxe-grid表格全量数据
303
+ */
304
+ const getTableData = () => {
305
+ return xgrid.value.getTableData().fullData;
306
+ };
307
+ /**
308
+ * @description 获取表格选中的行
309
+ * @return vxe-grid表格勾选行
310
+ */
311
+ const getSelectRecords = (isFull = false) => {
312
+ const columnType = props.columns[0].type;
313
+ const checkRecords =
314
+ columnType === 'radio' ? xgrid.value.getRadioRecord(isFull) : xgrid.value.getCheckboxRecords(isFull);
315
+ if (columnType === 'checkbox' && !checkRecords.length) {
316
+ warnMessage(t('message.tip_selectedRecord'));
317
+ return [];
318
+ } else if (columnType === 'radio' && !checkRecords) {
319
+ warnMessage(t('message.tip_selectedRecord'));
320
+ return null;
321
+ }
322
+ return checkRecords;
323
+ };
324
+
325
+ let sortable2: any;
326
+ const columnDrop = () => {
327
+ const $grid = xgrid.value;
328
+ sortable2 = Sortable.create($grid.$el.querySelector('.vxe-table--header .vxe-header--row'), {
329
+ disabled: !attrs.gridId,
330
+ handle: '.vxe-header--column',
331
+ onEnd: async sortableEvent => {
332
+ const targetThElem = sortableEvent.item;
333
+ const newIndex = sortableEvent.newIndex as number;
334
+ const oldIndex = sortableEvent.oldIndex as number;
335
+ const { fullColumn, tableColumn } = $grid.getTableColumn();
336
+ const wrapperElem = targetThElem.parentNode as HTMLElement;
337
+ const newColumn = fullColumn[newIndex];
338
+ const item = fullColumn[oldIndex];
339
+ let nodrag = false;
340
+ let msg = '固定列';
341
+ if (newColumn.fixed) {
342
+ nodrag = false;
343
+ } else if (newIndex === 0 || ['checkbox', 'radio'].includes(item.type)) {
344
+ msg = '勾选列';
345
+ nodrag = true;
346
+ } else if (item.field === 'operate' || newIndex === fullColumn.length - 1) {
347
+ nodrag = true;
348
+ msg = '操作列';
349
+ }
350
+ if (nodrag) {
351
+ // 错误的移动
352
+ const oldThElem = wrapperElem.children[oldIndex] as HTMLElement;
353
+ if (newIndex > oldIndex) {
354
+ wrapperElem.insertBefore(targetThElem, oldThElem);
355
+ } else {
356
+ wrapperElem.insertBefore(targetThElem, oldThElem ? oldThElem.nextElementSibling : oldThElem);
357
+ }
358
+ return errorMessage(msg + '不允许拖动!');
359
+ }
360
+ // 获取列索引 columnIndex > fullColumn
361
+ const oldColumnIndex = $grid.getColumnIndex(tableColumn[oldIndex]);
362
+ const newColumnIndex = $grid.getColumnIndex(tableColumn[newIndex]);
363
+ // 移动到目标列
364
+ const currRow = fullColumn.splice(oldColumnIndex, 1)[0];
365
+ fullColumn.splice(newColumnIndex, 0, currRow);
366
+
367
+ // 拖拽方向 1: 右 -1: 左
368
+ const direction = newColumnIndex - oldColumnIndex > 0 ? 1 : -1;
369
+
370
+ // 获取新列
371
+ const newSort = (newColumnIndex + 1) * 10;
372
+ const oldSort = (oldColumnIndex + 1) * 10;
373
+ // 目标列索引+1,方便后续计算
374
+ const comparisonVal = newSort + 1 * direction;
375
+ for (const key in cacheColumns) {
376
+ const cacheValue = cacheColumns[key];
377
+ if (direction > 0 && cacheValue < comparisonVal && cacheValue > oldSort) {
378
+ // 大于拖拽列且小于目标列的索引,均向前移动一个单位
379
+ cacheColumns[key] = cacheValue - 10 * direction;
380
+ } else if (direction < 0 && cacheValue > comparisonVal && cacheValue < oldSort) {
381
+ // 小于拖拽列且大于目标列的索引, 均向后移动一个单位
382
+ cacheColumns[key] = cacheValue - 10 * direction;
383
+ }
384
+ }
385
+
386
+ cacheColumns[currRow.field] = newSort;
387
+
388
+ dbstorage.setItem(kSTORECOLUM, { [attrs.gridId]: cacheColumns });
389
+ $grid.loadColumn(fullColumn);
390
+ }
391
+ });
392
+ };
393
+
394
+ /**
395
+ * @description 常用查询面板确认查询
396
+ * @param data 常用查询条件
397
+ */
398
+ const onSearch = data => {
399
+ showModal.value = false;
400
+ const { form } = xgrid.value.getProxyInfo();
401
+ Object.assign(form, data);
402
+ refreshData();
403
+ };
404
+
405
+ const querySuccess = e => {
406
+ console.log(e);
407
+ };
408
+
409
+ /**
410
+ * @description Vue实例对外暴露的相关方法或属性
411
+ */
412
+ defineExpose({
413
+ getTableData,
414
+ getSelectRecords,
415
+ refreshData,
416
+ refreshColumn,
417
+ getInstance,
418
+ showLoading,
419
+ hiddenLoading
420
+ });
421
+
422
+ const toolbarButtonClick = ({ code }) => {
423
+ emit('buttonClick', code);
424
+ };
425
+ const cellClick = e => {
426
+ emit('cellClick', e);
427
+ };
428
+ const cellDbclick = e => {
429
+ emit('cellDbclick', e);
430
+ };
431
+ const editEctivated = e => {
432
+ emit('editEctivated', e);
433
+ };
434
+
435
+ /**
436
+ * @description: 监听窗口变化,动态改变表格的高度
437
+ */
438
+ const addResizeListener = () => {
439
+ window.onresize = () => {
440
+ return (() => {
441
+ console.log('onresize');
442
+ let height = attrs?.height || window.innerHeight - 90 - 1;
443
+ if (attrs?.mode === 'form' && !attrs?.height) {
444
+ height = window.innerHeight - 180;
445
+ }
446
+ data.height = height < 240 ? 240 : height;
447
+ console.log(data.height);
448
+ })();
449
+ };
450
+ };
451
+
452
+ let initTime: any;
453
+ nextTick(() => {
454
+ // 加载完成之后在绑定拖动事件
455
+ initTime = setTimeout(() => {
456
+ columnDrop();
457
+ }, 500);
458
+ });
459
+
460
+ /**
461
+ * @description Vue实例卸载
462
+ */
463
+ onUnmounted(() => {
464
+ clearTimeout(initTime);
465
+ sortable2 && sortable2.destroy();
466
+ });
467
+ /**
468
+ * @description Vue实例挂载
469
+ */
470
+ onBeforeMount(() => {
471
+ setGridConfig();
472
+ addResizeListener();
473
+ });
474
+
475
+ const emit = defineEmits<{
476
+ (e: 'buttonClick', code: string): void;
477
+ (e: 'cellClick', data: any): void;
478
+ (e: 'cellDbclick', data: any): void;
479
+ (e: 'editEctivated', data: any): void;
480
+ }>();
481
+ </script>
482
+
483
+ <style lang="scss">
484
+ .ut-grid-wrapper {
485
+ padding: 5px;
486
+ background-color: #fff;
487
+
488
+ .vxe-form--item {
489
+ padding: 0.1em 0.8em 0.1em 0 !important;
490
+
491
+ .el-select {
492
+ .el-input {
493
+ height: 26px;
494
+ }
495
+
496
+ .el-select__tags-text {
497
+ color: #000;
498
+ }
499
+ }
500
+ }
501
+ .vxe-grid--layout-body-content-wrapper {
502
+ overflow: hidden;
503
+ }
504
+ }
505
+ </style>
@@ -1,4 +1,7 @@
1
- import UtModalForm2 from './modal-form.vue';
2
- import FormUpload2 from './form-upload.vue';
3
-
4
- export { UtModalForm2, FormUpload2 };
1
+ import UtModalForm2 from './modal-form.vue';
2
+ import FormUpload2 from './form-upload.vue';
3
+ import utLov2 from './lov.vue';
4
+ import UtModalGrid2 from './modal-grid.vue';
5
+ import UtGrid2 from './grid.vue';
6
+
7
+ export { UtGrid2, UtModalForm2, FormUpload2, utLov2, UtModalGrid2 };