@vue-ui-kit/ant 2.1.6 → 2.1.8
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/cjs/index.js +5 -5
- package/dist/es/index.js +5155 -4518
- package/dist/packages/components/PCanvasTable.vue.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/style.scss +6 -3
- package/package.json +2 -2
- package/src/packages/components/PCanvasGrid.vue +14 -20
- package/src/packages/components/PCanvasTable.vue +13 -1
- package/src/packages/components/PForm.vue +7 -12
- package/src/packages/components/PGrid.vue +10 -15
- package/src/packages/styles/index.scss +6 -3
|
@@ -56,6 +56,7 @@ declare const _default: <T extends Recordable = Recordable, B extends Recordable
|
|
|
56
56
|
drawCellBgColor: string;
|
|
57
57
|
drawCellSkyBgColor: string;
|
|
58
58
|
drawTextColor: string;
|
|
59
|
+
drawTextFont: string;
|
|
59
60
|
drawTextX: number;
|
|
60
61
|
drawTextY: number;
|
|
61
62
|
drawTextWidth: number;
|
|
@@ -107,6 +108,7 @@ declare const _default: <T extends Recordable = Recordable, B extends Recordable
|
|
|
107
108
|
editorType: string;
|
|
108
109
|
level: number;
|
|
109
110
|
text: string;
|
|
111
|
+
hide: boolean;
|
|
110
112
|
displayText: string;
|
|
111
113
|
colspan: number;
|
|
112
114
|
rowspan: number;
|
|
@@ -139,6 +141,7 @@ declare const _default: <T extends Recordable = Recordable, B extends Recordable
|
|
|
139
141
|
drawTextHeight: number;
|
|
140
142
|
drawCellBgColor: string;
|
|
141
143
|
drawTextColor: string;
|
|
144
|
+
drawTextFont: string;
|
|
142
145
|
drawSelectionImageX: number;
|
|
143
146
|
drawSelectionImageY: number;
|
|
144
147
|
drawSelectionImageWidth: number;
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";:root{--p-theme-bg: #fff;--collapsible-card-body-padding: 12px}.p-pane{background-color:var(--p-theme-bg);padding:16px;border-radius:4px}.text-slate-5{color:#64748b}.w-full{width:100%}.cursor-pointer{cursor:pointer}.py-4x{padding-top:4px;padding-bottom:4px}.px-2x{padding-left:2px;padding-right:2px}.pl-4x{padding-left:1em}.pl-8{padding-left:2em}.h-0{height:0}.h-full{height:100%}.flex{display:flex}.flex-col{flex-direction:column}.flex-1{flex:1}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-4px{gap:4px}.gap-8px{gap:8px}.pt-8px{padding-top:8px}.px-16px{padding-left:16px;padding-right:16px}.mt-4px{margin-top:4px}.text-right{text-align:right}.overflow-y-auto{overflow-y:auto}.p-theme-bg{background-color:var(--p-theme-bg)}.p-wrapper .p-form-wrapper{z-index:4}.p-wrapper .p-canvas-pagination.ant-pagination{padding:16px 0}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-wrapper .p-error-hang-out .ant-form-item-explain-error{opacity:0!important;transform:translateY(-10px)!important;max-height:0!important;overflow:hidden!important;transition:none!important}.p-wrapper .ant-form-item-explain-error{opacity:0;transform:translateY(-10px);max-height:0;overflow:hidden;transition:opacity .3s ease-out .3s,transform .3s ease-out .3s,max-height .3s ease-out .3s}.p-wrapper .ant-form-item-has-error .ant-form-item-explain-error{opacity:1;transform:translateY(0);max-height:100px}.p-wrapper .p-toolbar-wrapper{box-shadow:0 8px #fff;border-radius:.5em .5em 0 0;margin-bottom:-.5em}.p-wrapper .p-canvas-toolbar-wrapper{box-shadow:0 8px #fff;border-radius:.5em .5em 0 0}.p-wrapper .ant-form .ant-form-item{margin-bottom:0}.p-wrapper .ant-form .ant-form-item.p-required .ant-form-item-label>label:before{display:inline-block;margin-inline-end:4px;color:#ff4d4f;font-size:14px;font-family:SimSun,sans-serif;line-height:1;content:"*"}.p-wrapper .ant-form .ant-form-item .ant-form-item-label{display:flex;align-items:start;justify-content:flex-end}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label{white-space:break-spaces;align-items:flex-start;height:fit-content;padding-top:.36em}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label:after{padding-left:4px;margin-inline-start:unset}.p-wrapper .ant-form.ant-form-vertical .ant-form-item .ant-form-item-label{justify-content:flex-start;font-weight:600}.p-wrapper .ant-table-sticky-scroll{visibility:hidden}.p-wrapper .ant-table-header.ant-table-sticky-holder:before{content:"";width:100%;position:absolute;height:22px;display:block;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);top:-16px}.p-wrapper .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:unset;padding:16px 0}.p-wrapper .h-lack .ant-table-wrapper .ant-table-pagination.ant-pagination{padding:unset;margin-top:8px}.p-wrapper .p-inner-scroll>.ant-table-wrapper{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container{height:100%;display:flex;flex-direction:column}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container>.ant-table{flex:1;height:0;overflow-y:hidden;border-radius:unset}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-container>.ant-table-body{position:relative}.p-wrapper .ant-pagination-options .ant-select{width:100px}.p-wrapper .ant-table-cell:not(.normal-break){word-break:break-all}.p-error-group-tab{position:relative;overflow:visible;color:#f5222d!important}.p-error-group-tab:after{content:"🏷️";position:absolute;top:-1em;right:0;width:1em;height:1em;font-size:.8em;animation:heartbeat 2s infinite}.ant-picker-dropdown .ant-picker-footer{padding-left:4px}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-error-hang-out .ant-form-item-explain-error{display:none}.no-error-border{border-color:#d9d9d9!important}.no-error-border:focus{border-color:#4096ff!important}@media (max-width: 575px){.p-wrapper .ant-form .ant-form-item .ant-form-item-label{justify-content:flex-start}}.collapsible-card{background-color:#fff;border-color:#f0f0f0}.collapsible-card .ant-collapse-header{padding:0 12px;min-height:38px;display:flex;align-items:center;font-weight:600}.collapsible-card .ant-collapse-content{border-color:#f0f0f0}.collapsible-card .ant-collapse-content .ant-collapse-content-box{padding:var(--collapsible-card-body-padding, 12px)}.collapsible-card .ant-collapse-item{border-color:#f0f0f0}.p-content-align-right.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;text-align:right}.p-content-align-center.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:center;align-items:center;text-align:center}@keyframes heartbeat{0%{transform:scale(1)}6%{transform:scale(1.22)}12%{transform:scale(1)}18%{transform:scale(1.18)}24%{transform:scale(1)}48%{transform:scale(1)}54%{transform:scale(1.22)}60%{transform:scale(1)}66%{transform:scale(1.18)}72%{transform:scale(1)}to{transform:scale(1)}}
|
|
1
|
+
@charset "UTF-8";:root{--p-theme-bg: #fff;--collapsible-card-body-padding: 12px}.p-pane{background-color:var(--p-theme-bg);padding:16px;border-radius:4px}.text-slate-5{color:#64748b}.w-full{width:100%}.cursor-pointer{cursor:pointer}.py-4x{padding-top:4px;padding-bottom:4px}.px-2x{padding-left:2px;padding-right:2px}.pl-4x{padding-left:1em}.pl-8{padding-left:2em}.h-0{height:0}.h-full{height:100%}.flex{display:flex}.flex-col{flex-direction:column}.flex-1{flex:1}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-4px{gap:4px}.gap-8px{gap:8px}.pt-8px{padding-top:8px}.px-16px{padding-left:16px;padding-right:16px}.mt-4px{margin-top:4px}.text-right{text-align:right}.overflow-y-auto{overflow-y:auto}.p-theme-bg{background-color:var(--p-theme-bg)}.p-wrapper .p-form-wrapper{z-index:4}.p-wrapper .p-canvas-pagination.ant-pagination{padding:16px 0}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-wrapper .p-error-hang-out .ant-form-item-explain-error{opacity:0!important;transform:translateY(-10px)!important;max-height:0!important;overflow:hidden!important;transition:none!important}.p-wrapper .ant-form-item-explain-error{opacity:0;transform:translateY(-10px);max-height:0;overflow:hidden;transition:opacity .3s ease-out .3s,transform .3s ease-out .3s,max-height .3s ease-out .3s}.p-wrapper .ant-form-item-has-error .ant-form-item-explain-error{opacity:1;transform:translateY(0);max-height:100px}.p-wrapper .p-toolbar-wrapper{box-shadow:0 8px #fff;border-radius:.5em .5em 0 0;margin-bottom:-.5em}.p-wrapper .p-canvas-toolbar-wrapper{box-shadow:0 8px #fff;border-radius:.5em .5em 0 0}.p-wrapper .ant-form .ant-form-item{margin-bottom:0}.p-wrapper .ant-form .ant-form-item.p-required .ant-form-item-label>label:before{display:inline-block;margin-inline-end:4px;color:#ff4d4f;font-size:14px;font-family:SimSun,sans-serif;line-height:1;content:"*"}.p-wrapper .ant-form .ant-form-item .ant-form-item-label{display:flex;align-items:start;justify-content:flex-end}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label{white-space:break-spaces;align-items:flex-start;height:fit-content;padding-top:.36em}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label:after{padding-left:4px;margin-inline-start:unset}.p-wrapper .ant-form.ant-form-vertical .ant-form-item .ant-form-item-label{justify-content:flex-start;font-weight:600}.p-wrapper .ant-table-sticky-scroll{visibility:hidden}.p-wrapper .ant-table-header.ant-table-sticky-holder:before{content:"";width:100%;position:absolute;height:22px;display:block;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);top:-16px}.p-wrapper .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:unset;padding:16px 0}.p-wrapper .h-lack .ant-table-wrapper .ant-table-pagination.ant-pagination{padding:unset;margin-top:8px}.p-wrapper .p-inner-scroll>.ant-table-wrapper{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container{height:100%;display:flex;flex-direction:column}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container>.ant-table{flex:1;height:0;overflow-y:hidden;border-radius:unset}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-container>.ant-table-body{position:relative}.p-wrapper .ant-pagination-options .ant-select{width:100px}.p-wrapper .ant-table-cell:not(.normal-break){word-break:break-all}.p-error-group-tab{position:relative;overflow:visible;color:#f5222d!important}.p-error-group-tab:after{content:"🏷️";position:absolute;top:-1em;right:0;width:1em;height:1em;font-size:.8em;animation:heartbeat 2s infinite}.ant-picker-dropdown .ant-picker-footer{padding-left:4px}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-error-hang-out .ant-form-item-explain-error{display:none}.no-error-border{border-color:#d9d9d9!important}.no-error-border:focus{border-color:#4096ff!important}@media (max-width: 575px){.p-wrapper .ant-form .ant-form-item .ant-form-item-label{justify-content:flex-start}}.collapsible-card{background-color:#fff;border-color:#f0f0f0}.collapsible-card .ant-collapse-header{padding:0 12px;min-height:38px;display:flex;align-items:center;font-weight:600}.collapsible-card .ant-collapse-content{border-color:#f0f0f0}.collapsible-card .ant-collapse-content .ant-collapse-content-box{padding:var(--collapsible-card-body-padding, 12px)}.collapsible-card .ant-collapse-item{border-color:#f0f0f0}.canvas-cell{display:flex;flex-direction:column;justify-content:center;padding:0 8px}.p-content-align-right.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;text-align:right}.p-content-align-center.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:center;align-items:center;text-align:center}@keyframes heartbeat{0%{transform:scale(1)}6%{transform:scale(1.22)}12%{transform:scale(1)}18%{transform:scale(1.18)}24%{transform:scale(1)}48%{transform:scale(1)}54%{transform:scale(1.22)}60%{transform:scale(1)}66%{transform:scale(1.18)}72%{transform:scale(1)}to{transform:scale(1)}}
|
package/dist/style.scss
CHANGED
|
@@ -333,9 +333,12 @@
|
|
|
333
333
|
/* #endregion */
|
|
334
334
|
|
|
335
335
|
/* #region EVirtTable */
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
.canvas-cell {
|
|
337
|
+
display: flex;
|
|
338
|
+
flex-direction: column;
|
|
339
|
+
justify-content: center;
|
|
340
|
+
padding: 0 8px;
|
|
341
|
+
}
|
|
339
342
|
/* #endregion */
|
|
340
343
|
|
|
341
344
|
@each $align in right center {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-ui-kit/ant",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "Vue3 UI Kit based on Ant Design",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"email": "adoin@qq.com"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"e-virt-table": "^1.
|
|
49
|
+
"e-virt-table": "^1.3.6",
|
|
50
50
|
"uuid": "^10.0.0",
|
|
51
51
|
"xe-utils": "^3.7.6"
|
|
52
52
|
},
|
|
@@ -5,17 +5,7 @@
|
|
|
5
5
|
name="PCanvasGrid"
|
|
6
6
|
>
|
|
7
7
|
import PCanvasTable from './PCanvasTable.vue';
|
|
8
|
-
import {
|
|
9
|
-
computed,
|
|
10
|
-
useAttrs,
|
|
11
|
-
ref,
|
|
12
|
-
Ref,
|
|
13
|
-
reactive,
|
|
14
|
-
onMounted,
|
|
15
|
-
watch,
|
|
16
|
-
toRefs,
|
|
17
|
-
onBeforeUnmount,
|
|
18
|
-
} from 'vue';
|
|
8
|
+
import { computed, useAttrs, ref, Ref, reactive, onMounted, toRefs, onBeforeUnmount } from 'vue';
|
|
19
9
|
import {
|
|
20
10
|
debounce,
|
|
21
11
|
get,
|
|
@@ -50,7 +40,10 @@
|
|
|
50
40
|
import { DownOutlined } from '@ant-design/icons-vue';
|
|
51
41
|
import { getCanvasTableDefaults, getGridDefaults } from '@/utils/config';
|
|
52
42
|
import { eachTree } from '@/utils/treeHelper';
|
|
53
|
-
const props = defineProps<PCanvasGridProps<D, F>>()
|
|
43
|
+
const props = withDefaults(defineProps<PCanvasGridProps<D, F>>(), {
|
|
44
|
+
lazyReset: () => getGridDefaults().lazyReset ?? false,
|
|
45
|
+
fitHeight: () => getGridDefaults().fitCanvasHeight ?? 100,
|
|
46
|
+
});
|
|
54
47
|
const attrs = useAttrs();
|
|
55
48
|
const emit = defineEmits<{
|
|
56
49
|
(
|
|
@@ -67,18 +60,17 @@
|
|
|
67
60
|
|
|
68
61
|
const { formConfig, pageConfig, columns, toolbarConfig, proxyConfig, config, staticConfig } =
|
|
69
62
|
toRefs(props);
|
|
70
|
-
const gridDefaults = getGridDefaults();
|
|
71
63
|
const canvasTableDefaults = getCanvasTableDefaults();
|
|
72
64
|
const renderFormKey = ref(uuid_v4());
|
|
73
65
|
const queryFormData = ref<Partial<F>>({}) as Ref<Partial<F>>;
|
|
66
|
+
|
|
67
|
+
// 只处理 config 的合并,其他属性通过 withDefaults 处理
|
|
74
68
|
const propsWithDefaults = computed(() => ({
|
|
75
69
|
...props,
|
|
76
70
|
config: {
|
|
77
71
|
...canvasTableDefaults,
|
|
78
72
|
...props.config,
|
|
79
73
|
},
|
|
80
|
-
lazyReset: props.lazyReset ?? gridDefaults.lazyReset ?? false,
|
|
81
|
-
fitCanvasHeight: props.fitHeight ?? gridDefaults.fitCanvasHeight ?? 100,
|
|
82
74
|
}));
|
|
83
75
|
const mode = computed<'list' | 'pagination' | 'bad'>(() =>
|
|
84
76
|
proxyConfig.value && proxyConfig.value.ajax
|
|
@@ -162,14 +154,16 @@
|
|
|
162
154
|
const selectedRecords = computed<D[]>(() =>
|
|
163
155
|
uniq(
|
|
164
156
|
Object.values(pageSelections.value).flat(),
|
|
165
|
-
(f) => f[
|
|
157
|
+
(f) => f[propsWithDefaults.value.config?.ROW_KEY ?? 'id'] as string | number,
|
|
166
158
|
),
|
|
167
159
|
);
|
|
168
160
|
const handleFormSubmit = () => {
|
|
169
161
|
resetPage();
|
|
170
162
|
};
|
|
171
163
|
const selectedRowKeys = computed<Array<string | number>>(() =>
|
|
172
|
-
selectedRecords.value.map(
|
|
164
|
+
selectedRecords.value.map(
|
|
165
|
+
(f) => f[propsWithDefaults.value.config?.ROW_KEY ?? 'id'] as string | number,
|
|
166
|
+
),
|
|
173
167
|
);
|
|
174
168
|
const handleResponse = (response: Recordable, pathConfig?: ResponsePathConfig<D>) =>
|
|
175
169
|
pathConfig
|
|
@@ -393,7 +387,7 @@
|
|
|
393
387
|
const showCountHeight = staticConfig.value?.showCount ? 22 : 0;
|
|
394
388
|
renderHeight.value =
|
|
395
389
|
toNumber(ph.replace('px', '')) -
|
|
396
|
-
|
|
390
|
+
props.fitHeight -
|
|
397
391
|
(props.toolbarConfig ? 30 : 0) -
|
|
398
392
|
formHeight -
|
|
399
393
|
showCountHeight;
|
|
@@ -464,7 +458,7 @@
|
|
|
464
458
|
:key="`_col_${item.field || idx}`"
|
|
465
459
|
:form-data="queryFormData"
|
|
466
460
|
:item="item as PFormItemProps<Partial<F>>"
|
|
467
|
-
@reset="resetQueryFormData(
|
|
461
|
+
@reset="resetQueryFormData(props.lazyReset)"
|
|
468
462
|
/>
|
|
469
463
|
</a-row>
|
|
470
464
|
</a-form>
|
|
@@ -551,7 +545,7 @@
|
|
|
551
545
|
ref="canvasTableRef"
|
|
552
546
|
:columns="finalColumns"
|
|
553
547
|
:config="{
|
|
554
|
-
...config,
|
|
548
|
+
...propsWithDefaults.config,
|
|
555
549
|
HEIGHT: renderHeight,
|
|
556
550
|
}"
|
|
557
551
|
@selection-change="handleSelectionChange"
|
|
@@ -111,6 +111,13 @@
|
|
|
111
111
|
|
|
112
112
|
return undefined;
|
|
113
113
|
};
|
|
114
|
+
const getRenderHeaderFunction = (column: CanvasColumnProps<T>) => {
|
|
115
|
+
if (column.slots?.title && isFunction(column.slots?.title)) {
|
|
116
|
+
return (cell: CellParams) => column.slots?.title?.({ column });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return undefined;
|
|
120
|
+
};
|
|
114
121
|
const parseToEVirtColumn = (column: CanvasColumnProps<T>): EVirtColumn => {
|
|
115
122
|
if (column.slots?.edit && (column.field || column.key) && isFunction(column.slots?.edit)) {
|
|
116
123
|
cacheEditorSlotColumns[`__slot:${column.field || column.key}`] = column;
|
|
@@ -135,6 +142,7 @@
|
|
|
135
142
|
? column.editRender.name
|
|
136
143
|
: undefined),
|
|
137
144
|
render: getRenderFunction(column),
|
|
145
|
+
renderHeader: getRenderHeaderFunction(column),
|
|
138
146
|
children: column.children?.map((child) => parseToEVirtColumn(child)),
|
|
139
147
|
};
|
|
140
148
|
};
|
|
@@ -164,6 +172,7 @@
|
|
|
164
172
|
});
|
|
165
173
|
eVirtTable.on('overlayerChange', (overlayer: OverlayerContainer) => {
|
|
166
174
|
overlayerView.value = overlayer;
|
|
175
|
+
console.log('overlayerChange', overlayer);
|
|
167
176
|
});
|
|
168
177
|
eVirtTable.on('startEdit', (cell) => {
|
|
169
178
|
editorCell.value = cell;
|
|
@@ -299,7 +308,10 @@
|
|
|
299
308
|
class="canvas-cell"
|
|
300
309
|
v-for="cell in view.cells"
|
|
301
310
|
:key="`${cell.rowKey}_${cell.key}`"
|
|
302
|
-
:style="
|
|
311
|
+
:style="{
|
|
312
|
+
...cell.style,
|
|
313
|
+
height: cell.height ? `${cell.height - 2}px` : 'auto',
|
|
314
|
+
}"
|
|
303
315
|
v-bind="cell.domDataset"
|
|
304
316
|
>
|
|
305
317
|
<component
|
|
@@ -9,17 +9,12 @@
|
|
|
9
9
|
import PFormCol from '@/components/PFormCol.vue';
|
|
10
10
|
import { Form as AForm, Row as ARow } from 'ant-design-vue';
|
|
11
11
|
|
|
12
|
-
const props = defineProps<PFormProps<F> & { data: F }>()
|
|
12
|
+
const props = withDefaults(defineProps<PFormProps<F> & { data: F }>(), {
|
|
13
|
+
labelCol: () => getFormDefaults().labelCol ?? { span: 6 },
|
|
14
|
+
wrapperCol: () => getFormDefaults().wrapperCol ?? { span: 16 },
|
|
15
|
+
});
|
|
13
16
|
const emit = defineEmits(['apply', 'reset']);
|
|
14
17
|
|
|
15
|
-
// 应用默认值
|
|
16
|
-
const formDefaults = getFormDefaults();
|
|
17
|
-
const propsWithDefaults = computed(() => ({
|
|
18
|
-
...props,
|
|
19
|
-
labelCol: props.labelCol ?? formDefaults.labelCol ?? { span: 6 },
|
|
20
|
-
wrapperCol: props.wrapperCol ?? formDefaults.wrapperCol ?? { span: 16 },
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
18
|
const { items, data: formData } = toRefs(props);
|
|
24
19
|
|
|
25
20
|
function handleSubmit() {
|
|
@@ -57,9 +52,9 @@
|
|
|
57
52
|
};
|
|
58
53
|
// omit({labelCol:defaultLabelCol,...props},['items','data','model'])
|
|
59
54
|
const fc = computed(() => ({
|
|
60
|
-
...omit(
|
|
61
|
-
labelCol:
|
|
62
|
-
wrapperCol:
|
|
55
|
+
...omit(props, ['items', 'data', 'model', 'labelCol', 'wrapperCol']),
|
|
56
|
+
labelCol: props.labelCol,
|
|
57
|
+
wrapperCol: props.wrapperCol,
|
|
63
58
|
}));
|
|
64
59
|
const validateField = (fields?: string | string[]) => {
|
|
65
60
|
if (fields) {
|
|
@@ -49,18 +49,13 @@
|
|
|
49
49
|
import { TablePaginationConfig } from 'ant-design-vue/es/table/interface';
|
|
50
50
|
import { DownOutlined } from '@ant-design/icons-vue';
|
|
51
51
|
|
|
52
|
-
const props = defineProps<PGridProps<D, F>>()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
scrollMode: props.scrollMode ?? 'inner',
|
|
60
|
-
align: props.align ?? gridDefaults.align ?? 'left',
|
|
61
|
-
lazyReset: props.lazyReset ?? gridDefaults.lazyReset ?? false,
|
|
62
|
-
fitHeight: props.fitHeight ?? gridDefaults.fitHeight ?? 170,
|
|
63
|
-
}));
|
|
52
|
+
const props = withDefaults(defineProps<PGridProps<D, F>>(), {
|
|
53
|
+
rowKey: 'id',
|
|
54
|
+
scrollMode: 'inner',
|
|
55
|
+
align: () => getGridDefaults().align ?? 'left',
|
|
56
|
+
lazyReset: () => getGridDefaults().lazyReset ?? false,
|
|
57
|
+
fitHeight: () => getGridDefaults().fitHeight ?? 170,
|
|
58
|
+
});
|
|
64
59
|
|
|
65
60
|
const {
|
|
66
61
|
formConfig,
|
|
@@ -440,7 +435,7 @@
|
|
|
440
435
|
renderHeight.value =
|
|
441
436
|
props.renderY ??
|
|
442
437
|
toNumber(ph.replace('px', '')) -
|
|
443
|
-
|
|
438
|
+
props.fitHeight -
|
|
444
439
|
(props.toolbarConfig ? 30 : 0) -
|
|
445
440
|
formHeight -
|
|
446
441
|
showCountHeight;
|
|
@@ -491,7 +486,7 @@
|
|
|
491
486
|
columns.map((c) => ({
|
|
492
487
|
...passFields.reduce(
|
|
493
488
|
(prev, cur) => ({
|
|
494
|
-
[cur]:
|
|
489
|
+
[cur]: props[cur],
|
|
495
490
|
}),
|
|
496
491
|
{} as ColumnProps<D>,
|
|
497
492
|
),
|
|
@@ -525,7 +520,7 @@
|
|
|
525
520
|
:key="`_col_${item.field || idx}`"
|
|
526
521
|
:form-data="queryFormData"
|
|
527
522
|
:item="item as PFormItemProps<Partial<F>>"
|
|
528
|
-
@reset="resetQueryFormData(
|
|
523
|
+
@reset="resetQueryFormData(props.lazyReset)"
|
|
529
524
|
/>
|
|
530
525
|
</a-row>
|
|
531
526
|
</a-form>
|
|
@@ -328,9 +328,12 @@
|
|
|
328
328
|
/* #endregion */
|
|
329
329
|
|
|
330
330
|
/* #region EVirtTable */
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
.canvas-cell {
|
|
332
|
+
display: flex;
|
|
333
|
+
flex-direction: column;
|
|
334
|
+
justify-content: center;
|
|
335
|
+
padding: 0 8px;
|
|
336
|
+
}
|
|
334
337
|
/* #endregion */
|
|
335
338
|
|
|
336
339
|
@each $align in right center {
|