sh-view 2.5.1 → 2.5.3
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/package.json
CHANGED
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
<div class="sh-drawer-body" :style="styles">
|
|
22
22
|
<slot v-if="modelValue || !destroyOnClose"></slot>
|
|
23
23
|
</div>
|
|
24
|
+
<div v-if="slots.footer" class="sh-drawer-footer">
|
|
25
|
+
<slot name="footer"></slot>
|
|
26
|
+
</div>
|
|
24
27
|
</div>
|
|
25
28
|
<div v-if="draggable && (placement === 'left' || placement === 'right')" class="sh-drawer-drag" :class="'sh-drawer-drag-' + placement" @mousedown="handleTriggerMousedown">
|
|
26
29
|
<slot name="trigger">
|
|
@@ -337,6 +340,7 @@ export default defineComponent({
|
|
|
337
340
|
})
|
|
338
341
|
|
|
339
342
|
return {
|
|
343
|
+
slots,
|
|
340
344
|
visible,
|
|
341
345
|
handleMask,
|
|
342
346
|
wrapClasses,
|
|
@@ -422,9 +426,8 @@ export default defineComponent({
|
|
|
422
426
|
&-content {
|
|
423
427
|
width: 100%;
|
|
424
428
|
height: 100%;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
bottom: 0;
|
|
429
|
+
display: flex;
|
|
430
|
+
flex-direction: column;
|
|
428
431
|
background-color: var(--vxe-table-body-background-color);
|
|
429
432
|
border: 0;
|
|
430
433
|
background-clip: padding-box;
|
|
@@ -463,16 +466,19 @@ export default defineComponent({
|
|
|
463
466
|
}
|
|
464
467
|
&-body {
|
|
465
468
|
width: 100%;
|
|
466
|
-
|
|
469
|
+
flex: 1;
|
|
467
470
|
padding: 16px;
|
|
468
471
|
font-size: var(--vxe-font-size);
|
|
469
472
|
line-height: 1.5;
|
|
470
473
|
word-wrap: break-word;
|
|
471
|
-
position:
|
|
474
|
+
position: relative;
|
|
472
475
|
overflow: auto;
|
|
473
476
|
}
|
|
474
|
-
&-
|
|
475
|
-
|
|
477
|
+
&-footer {
|
|
478
|
+
position: relative;
|
|
479
|
+
border-top: 1px solid var(--vxe-table-border-color);
|
|
480
|
+
padding: 14px 16px;
|
|
481
|
+
line-height: 1;
|
|
476
482
|
}
|
|
477
483
|
&-no-mask {
|
|
478
484
|
pointer-events: none;
|
|
@@ -4,9 +4,8 @@ import { columnDefaultFilterMethod, tableFooterCompute, getTransfarFields, getFi
|
|
|
4
4
|
const globalConfigDefault = {
|
|
5
5
|
tableName: '',
|
|
6
6
|
title: false, // 是否显示 tableName
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
seq: true, // 是否展示序号列
|
|
7
|
+
selectType: '', // 是否选择框 空 radio checkbox
|
|
8
|
+
seq: false, // 是否展示序号列
|
|
10
9
|
ghost: false, // 是否开启透明
|
|
11
10
|
search: false, // 表格是否开启查询,默认不开启,根据columns配置字段 search 为 true
|
|
12
11
|
globalFilter: false, // 表格是否开启全局过滤
|
|
@@ -37,11 +36,11 @@ const toolsList = [
|
|
|
37
36
|
// 表头默认值
|
|
38
37
|
const columnObjDefault = { minWidth: 120, sortable: true, filter: true }
|
|
39
38
|
// 表头默认列
|
|
40
|
-
const
|
|
41
|
-
{ title: '', type: 'checkbox', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-checkbox' },
|
|
42
|
-
{ title: '单选', type: 'radio', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-radio' },
|
|
43
|
-
{ title: '序号', type: 'seq', width: 70, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-seq' }
|
|
44
|
-
|
|
39
|
+
const columnsMapDefault = {
|
|
40
|
+
checkbox: { title: '', type: 'checkbox', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-checkbox' },
|
|
41
|
+
radio: { title: '单选', type: 'radio', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-radio' },
|
|
42
|
+
seq: { title: '序号', type: 'seq', width: 70, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-seq' }
|
|
43
|
+
}
|
|
45
44
|
|
|
46
45
|
export default function (props, context, proxy, isGrid) {
|
|
47
46
|
const { $vUtils, $vxePluginNames } = proxy
|
|
@@ -70,9 +69,18 @@ export default function (props, context, proxy, isGrid) {
|
|
|
70
69
|
return toolsList.filter(tool => tools.includes(tool.code))
|
|
71
70
|
})
|
|
72
71
|
const tableViewData = computed(() => tableFilterData.value || props.dataSourse)
|
|
72
|
+
const tablePrevColumns = computed(() => {
|
|
73
|
+
let prevColumns = []
|
|
74
|
+
let prevFields = ['seq', 'selectType']
|
|
75
|
+
prevFields.forEach(prev => {
|
|
76
|
+
if (tableGlobalConfig.value[prev]) {
|
|
77
|
+
prevColumns.push(columnsMapDefault[prev])
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
return prevColumns
|
|
81
|
+
})
|
|
73
82
|
const tableColumns = computed(() => {
|
|
74
|
-
|
|
75
|
-
return defaultColumns.concat(tableColumnsFixed.value)
|
|
83
|
+
return tablePrevColumns.value.concat(tableColumnsFixed.value)
|
|
76
84
|
})
|
|
77
85
|
const tableColumnObjConfig = computed(() => Object.assign({}, columnObjDefault, props.columnObj))
|
|
78
86
|
const tableColumnConfig = computed(() => Object.assign({ isCurrent: false, isHover: true, resizable: true }, props.columnConfig))
|
|
@@ -184,8 +192,7 @@ export default function (props, context, proxy, isGrid) {
|
|
|
184
192
|
return footerData
|
|
185
193
|
}
|
|
186
194
|
const tableFooterSpanMethod = ({ $rowIndex, column, $columnIndex, data }) => {
|
|
187
|
-
let
|
|
188
|
-
let colspan = defaultColumns.length || 1
|
|
195
|
+
let colspan = tablePrevColumns.value.length || 1
|
|
189
196
|
if (column.type === 'seq') {
|
|
190
197
|
return { rowspan: 1, colspan: colspan }
|
|
191
198
|
} else if (column.type === 'checkbox' || column.type === 'radio') {
|
|
@@ -533,6 +540,7 @@ export default function (props, context, proxy, isGrid) {
|
|
|
533
540
|
renderKey,
|
|
534
541
|
wrapHeight,
|
|
535
542
|
tableGlobalConfig,
|
|
543
|
+
tablePrevColumns,
|
|
536
544
|
tableColumns,
|
|
537
545
|
tableColumnConfig,
|
|
538
546
|
tableColumnObjConfig,
|
|
@@ -553,7 +561,6 @@ export default function (props, context, proxy, isGrid) {
|
|
|
553
561
|
tableSlots,
|
|
554
562
|
selectionRows,
|
|
555
563
|
importVisible,
|
|
556
|
-
columnsConfigDefault,
|
|
557
564
|
tableFooterMethod,
|
|
558
565
|
tableFooterSpanMethod,
|
|
559
566
|
onCurrentChange,
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
@toolbar-button-click="onToolbarButtonClick"
|
|
117
117
|
@toolbar-tool-click="onToolbarToolClick"
|
|
118
118
|
@option-click="handleGoptionClick">
|
|
119
|
-
<template v-for="(column, columnIndex) in
|
|
120
|
-
<vxe-column v-
|
|
119
|
+
<template v-for="(column, columnIndex) in tablePrevColumns" :key="columnIndex">
|
|
120
|
+
<vxe-column v-bind="column"></vxe-column>
|
|
121
121
|
</template>
|
|
122
122
|
<template v-for="(column, columnIndex) in columns" :key="columnIndex">
|
|
123
123
|
<sh-column :column="column"></sh-column>
|