@vue-ui-kit/ant 2.0.2 → 2.0.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.
@@ -4,22 +4,15 @@
4
4
  name="PromisePicker"
5
5
  generic="D extends Recordable = Recordable, F extends Recordable = Recordable"
6
6
  >
7
- import { reactive, ref, computed } from 'vue';
7
+ import { reactive, ref, computed, onMounted, nextTick } from 'vue';
8
8
  import { PGridInstance, PromisePickerProps } from '#/antProxy';
9
9
  import PGrid from '@/components/PGrid.vue';
10
10
  import { $warning } from '@/hooks/useMessage';
11
11
  import { Button as AButton, Modal as AModal } from 'ant-design-vue';
12
12
 
13
13
  const gridEl = ref<PGridInstance<D>>();
14
- const defaultBodyStyle = {
15
- minHeight: '642px',
16
- };
17
- const mergedBodyStyle = computed(() => {
18
- return {
19
- ...defaultBodyStyle,
20
- ...props.bodyStyle,
21
- };
22
- });
14
+
15
+ const rendered = ref(false);
23
16
  const props = withDefaults(defineProps<PromisePickerProps<D, F>>(), {
24
17
  title: '数据选择',
25
18
  width: '70%',
@@ -68,18 +61,27 @@
68
61
  });
69
62
  }
70
63
  };
64
+ onMounted(() => {});
71
65
  defineExpose({
72
66
  pick: () =>
73
67
  new Promise<{ row: D; field?: string } | D[]>((resolve, reject) => {
74
68
  resolvePromise = resolve;
75
69
  rejectPromise = reject;
70
+ rendered.value = false;
76
71
  visible.modal = true;
72
+ nextTick(() => {
73
+ rendered.value = true;
74
+ });
77
75
  }),
78
76
  pickMultiple: () =>
79
77
  new Promise<{ row: D; field?: string } | D[]>((resolve, reject) => {
80
78
  multipleResolver = resolve;
81
79
  rejectPromise = reject;
80
+ rendered.value = false;
82
81
  visible.modal = true;
82
+ nextTick(() => {
83
+ rendered.value = true;
84
+ });
83
85
  }),
84
86
  grid: gridEl,
85
87
  hide: () => {
@@ -95,9 +97,11 @@
95
97
  :width="width"
96
98
  :footer="isMultiple ? undefined : null"
97
99
  @cancel="handleCancel"
98
- :body-style="mergedBodyStyle"
100
+ :body-style="bodyStyle"
99
101
  >
100
- <p-grid v-bind="gridSetting" ref="gridEl" @pick="selectRow" />
102
+ <div :style="{ minHeight: rendered ? 'unset' : '642px' }">
103
+ <p-grid v-bind="gridSetting" ref="gridEl" @pick="selectRow" />
104
+ </div>
101
105
  <template v-if="isMultiple" #footer>
102
106
  <div class="w-full text-right p-2">
103
107
  <span>
@@ -5,8 +5,10 @@
5
5
  padding: 16px;
6
6
  border-radius: 4px;
7
7
  }
8
-
9
- //region patch for env without unocss/tailwind/windicss
8
+ .text-slate-5 {
9
+ color: #64748b;
10
+ }
11
+ /* #region patch for env without unocss/tailwind/windicss */
10
12
  .w-full {
11
13
  width: 100%;
12
14
  }
@@ -88,9 +90,9 @@
88
90
  overflow-y: auto;
89
91
  }
90
92
 
91
- //endregion
93
+ /* #endregion */
92
94
 
93
- //region P family styles
95
+ /* #region P family styles */
94
96
  .p-theme-bg {
95
97
  background-color: var(--p-theme-bg);
96
98
  }
@@ -99,6 +101,9 @@
99
101
  .p-form-wrapper {
100
102
  z-index: 4;
101
103
  }
104
+ .p-canvas-pagination.ant-pagination {
105
+ padding: 16px 0;
106
+ }
102
107
  .p-error-hang-out {
103
108
  .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
104
109
  .ant-input-affix-wrapper-borderless
@@ -137,6 +142,10 @@
137
142
  border-radius: 0.5em 0.5em 0 0;
138
143
  margin-bottom: -0.5em;
139
144
  }
145
+ .p-canvas-toolbar-wrapper {
146
+ box-shadow: 0 8px #fff;
147
+ border-radius: 0.5em 0.5em 0 0;
148
+ }
140
149
 
141
150
  .ant-form {
142
151
  .ant-form-item {
@@ -205,7 +214,12 @@
205
214
  margin: unset;
206
215
  padding: 16px 0;
207
216
  }
208
-
217
+ .h-lack {
218
+ .ant-table-wrapper .ant-table-pagination.ant-pagination {
219
+ padding: unset;
220
+ margin-top: 8px;
221
+ }
222
+ }
209
223
  .p-inner-scroll {
210
224
  & > .ant-table-wrapper {
211
225
  height: 100%;
@@ -219,11 +233,15 @@
219
233
  flex-direction: column;
220
234
 
221
235
  & > .ant-table {
222
- //flex: 1;
223
- //height: 0;
224
- //overflow: auto;
236
+ flex: 1;
237
+ height: 0;
238
+ overflow-y: hidden;
225
239
  /*border-radius: unset; 修复模糊问题 according to https://stackoverflow.com/questions/49349337/chrome-text-blur-with-overflow-yscroll-and-fixed-height*/
226
240
  border-radius: unset;
241
+
242
+ & > .ant-table-container > .ant-table-body {
243
+ position: relative;
244
+ }
227
245
  }
228
246
  }
229
247
  }
@@ -235,6 +253,9 @@
235
253
  width: 100px;
236
254
  }
237
255
  }
256
+ .ant-table-cell:not(.normal-break) {
257
+ word-break: break-all;
258
+ }
238
259
  }
239
260
  .p-error-group-tab {
240
261
  position: relative;
@@ -251,6 +272,11 @@
251
272
  animation: heartbeat 2s infinite;
252
273
  }
253
274
  }
275
+ .ant-picker-dropdown {
276
+ .ant-picker-footer {
277
+ padding-left: 4px;
278
+ }
279
+ }
254
280
  .p-error-hang-out {
255
281
  .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
256
282
  .ant-input-affix-wrapper-borderless
@@ -265,6 +291,7 @@
265
291
  display: none;
266
292
  }
267
293
  }
294
+
268
295
  .no-error-border {
269
296
  border-color: #d9d9d9 !important;
270
297
 
@@ -272,10 +299,17 @@
272
299
  border-color: #4096ff !important;
273
300
  }
274
301
  }
275
- //endregion
302
+ @media (max-width: 575px) {
303
+ .p-wrapper .ant-form .ant-form-item .ant-form-item-label {
304
+ justify-content: flex-start;
305
+ }
306
+ }
307
+ /* #endregion */
276
308
 
277
309
  /* #region EVirtTable */
278
-
310
+ // .canvas-cell{
311
+ // tbd
312
+ // }
279
313
  /* #endregion */
280
314
 
281
315
  @each $align in right center {
@@ -1,4 +1,5 @@
1
1
  import { PFormProps, PGridProps } from '#/antProxy';
2
+ import { ConfigType } from 'e-virt-table';
2
3
  import { clone } from 'xe-utils';
3
4
 
4
5
  // 全局配置接口
@@ -11,7 +12,9 @@ export interface UIKitConfig {
11
12
  align?: 'left' | 'right' | 'center';
12
13
  lazyReset?: boolean;
13
14
  fitHeight?: number;
15
+ fitCanvasHeight?: number;
14
16
  };
17
+ canvasTable?: ConfigType;
15
18
  }
16
19
 
17
20
  // 默认配置
@@ -25,6 +28,9 @@ const defaultConfig: UIKitConfig = {
25
28
  lazyReset: false,
26
29
  fitHeight: 170,
27
30
  },
31
+ canvasTable: {
32
+ DISABLED: true,
33
+ },
28
34
  };
29
35
 
30
36
  // 当前配置(可被修改)
@@ -41,6 +47,10 @@ export function setUIKitConfig(config: Partial<UIKitConfig>): void {
41
47
  ...currentConfig.grid,
42
48
  ...config.grid,
43
49
  },
50
+ canvasTable: {
51
+ ...currentConfig.canvasTable,
52
+ ...config.canvasTable,
53
+ },
44
54
  };
45
55
  }
46
56
 
@@ -66,7 +76,12 @@ export function getGridDefaults(): Partial<PGridProps> {
66
76
  };
67
77
  }
68
78
 
79
+ // 获取CanvasTable默认配置
80
+ export function getCanvasTableDefaults(): ConfigType {
81
+ return currentConfig.canvasTable || ({} as ConfigType);
82
+ }
83
+
69
84
  // 重置为默认配置
70
85
  export function resetUIKitConfig(): void {
71
86
  currentConfig = JSON.parse(JSON.stringify(defaultConfig));
72
- }
87
+ }