ct-component-plus 0.0.35 → 0.0.37
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
|
@@ -128,8 +128,10 @@ export default {
|
|
|
128
128
|
const getPageData = async (download = false) => {
|
|
129
129
|
let dataP = {
|
|
130
130
|
...state.searchParams,
|
|
131
|
-
...state.sortObj,
|
|
132
131
|
};
|
|
132
|
+
if (state.sortObj?.order && state.sortObj?.prop) {
|
|
133
|
+
dataP.sortObj = state.sortObj;
|
|
134
|
+
}
|
|
133
135
|
if (props.pageSize) {
|
|
134
136
|
dataP.pageSize = props.pageSize;
|
|
135
137
|
dataP.pageNo = state.pageNo;
|
|
@@ -36,12 +36,12 @@ export const tableProps = {
|
|
|
36
36
|
type: Object,
|
|
37
37
|
default: () => {
|
|
38
38
|
return {
|
|
39
|
-
width:'88'
|
|
39
|
+
width: '88'
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
teleportDom: {
|
|
44
|
-
type:[String, Node],
|
|
44
|
+
type: [String, Node],
|
|
45
45
|
},
|
|
46
46
|
defaultSort: {
|
|
47
47
|
type: Object,
|
|
@@ -56,4 +56,5 @@ export const tableProps = {
|
|
|
56
56
|
type: String,
|
|
57
57
|
default: "暂无数据",
|
|
58
58
|
},
|
|
59
|
+
mergeList: Array,
|
|
59
60
|
}
|
|
@@ -8,15 +8,13 @@
|
|
|
8
8
|
:span-method="spanMethod"
|
|
9
9
|
@selection-change="handleSelectChange"
|
|
10
10
|
row-key="rowKey"
|
|
11
|
-
v-bind="$attrs"
|
|
12
|
-
>
|
|
11
|
+
v-bind="$attrs">
|
|
13
12
|
<el-table-column
|
|
14
13
|
v-if="isMultiSelect"
|
|
15
14
|
type="selection"
|
|
16
15
|
width="88"
|
|
17
16
|
v-bind="multiSelectAttr"
|
|
18
|
-
:reserve-selection="true"
|
|
19
|
-
></el-table-column>
|
|
17
|
+
:reserve-selection="true"></el-table-column>
|
|
20
18
|
<el-table-column
|
|
21
19
|
v-for="(column, index) in columnData"
|
|
22
20
|
:key="column.value + '-' + column.label"
|
|
@@ -29,16 +27,14 @@
|
|
|
29
27
|
:align="column.align || 'center'"
|
|
30
28
|
:fixed="column.fixed || false"
|
|
31
29
|
show-overflow-tooltip
|
|
32
|
-
v-bind="column.rawAttr || {}"
|
|
33
|
-
>
|
|
30
|
+
v-bind="column.rawAttr || {}">
|
|
34
31
|
<template #header="scope" v-if="column.slotHeader">
|
|
35
32
|
<slot
|
|
36
33
|
:name="column.value + 'Header'"
|
|
37
34
|
v-bind="scope"
|
|
38
35
|
:column="column"
|
|
39
36
|
:label="column.label"
|
|
40
|
-
:value="column.value"
|
|
41
|
-
>
|
|
37
|
+
:value="column.value">
|
|
42
38
|
</slot>
|
|
43
39
|
</template>
|
|
44
40
|
<template #default="scope">
|
|
@@ -46,8 +42,7 @@
|
|
|
46
42
|
:name="column.value"
|
|
47
43
|
:value="scope.row[column.value]"
|
|
48
44
|
v-bind="scope"
|
|
49
|
-
:column="column"
|
|
50
|
-
>
|
|
45
|
+
:column="column">
|
|
51
46
|
<span>{{ scope.row[column.value] }}</span>
|
|
52
47
|
</slot>
|
|
53
48
|
<el-table-column
|
|
@@ -62,15 +57,13 @@
|
|
|
62
57
|
:align="column1.align || 'center'"
|
|
63
58
|
:fixed="column1.fixed || false"
|
|
64
59
|
show-overflow-tooltip
|
|
65
|
-
v-bind="column1.rawAttr || {}"
|
|
66
|
-
>
|
|
60
|
+
v-bind="column1.rawAttr || {}">
|
|
67
61
|
<template #default="scope">
|
|
68
62
|
<slot
|
|
69
63
|
:name="column1.value"
|
|
70
64
|
:value="scope.row[column1.value]"
|
|
71
65
|
v-bind="scope"
|
|
72
|
-
:column="column1"
|
|
73
|
-
>
|
|
66
|
+
:column="column1">
|
|
74
67
|
<span>{{ scope.row[column1.value] }}</span>
|
|
75
68
|
</slot>
|
|
76
69
|
</template>
|
|
@@ -82,8 +75,7 @@
|
|
|
82
75
|
<component
|
|
83
76
|
:is="tableEmptyDom"
|
|
84
77
|
v-if="tableEmptyDom"
|
|
85
|
-
:text="emptyText"
|
|
86
|
-
>
|
|
78
|
+
:text="emptyText">
|
|
87
79
|
</component>
|
|
88
80
|
<span v-else>{{ emptyText }}</span>
|
|
89
81
|
</slot>
|
|
@@ -95,8 +87,7 @@
|
|
|
95
87
|
:total="total"
|
|
96
88
|
:current-page="pageNo"
|
|
97
89
|
v-if="pageSize"
|
|
98
|
-
@current-change="handleCurrentChange"
|
|
99
|
-
></ct-pagination>
|
|
90
|
+
@current-change="handleCurrentChange"></ct-pagination>
|
|
100
91
|
</div>
|
|
101
92
|
<Teleport :to="`#${teleportDom}`" v-if="teleportDom && teleportStatus">
|
|
102
93
|
<table-sort v-model:sort-obj="sortObj" :sort-list="sortList"></table-sort>
|
|
@@ -174,7 +165,7 @@ let spanObj = {};
|
|
|
174
165
|
watch(
|
|
175
166
|
() => props.mergeList,
|
|
176
167
|
(newVal, oldVal) => {
|
|
177
|
-
let
|
|
168
|
+
let spanObjRes = {};
|
|
178
169
|
if (Array.isArray(newVal)) {
|
|
179
170
|
newVal.forEach((item) => {
|
|
180
171
|
const { row, col, span } = item;
|
|
@@ -187,10 +178,10 @@ watch(
|
|
|
187
178
|
let res = i === 1 && j === 1 ? span : [0, 0];
|
|
188
179
|
const rowKey = row + i - 1;
|
|
189
180
|
const colKey = col + j - 1;
|
|
190
|
-
if (
|
|
191
|
-
|
|
181
|
+
if (spanObjRes[rowKey]) {
|
|
182
|
+
spanObjRes[rowKey][colKey] = res;
|
|
192
183
|
} else {
|
|
193
|
-
|
|
184
|
+
spanObjRes[rowKey] = {
|
|
194
185
|
[colKey]: res,
|
|
195
186
|
};
|
|
196
187
|
}
|
|
@@ -198,7 +189,7 @@ watch(
|
|
|
198
189
|
}
|
|
199
190
|
});
|
|
200
191
|
}
|
|
201
|
-
spanObj =
|
|
192
|
+
spanObj = spanObjRes;
|
|
202
193
|
},
|
|
203
194
|
{ immediate: true }
|
|
204
195
|
);
|
|
@@ -252,7 +243,7 @@ onMounted(() => {
|
|
|
252
243
|
|
|
253
244
|
defineExpose({ tableRef });
|
|
254
245
|
</script>
|
|
255
|
-
<style lang=
|
|
246
|
+
<style lang="less" scoped>
|
|
256
247
|
.ct-table__body {
|
|
257
248
|
width: 100%;
|
|
258
249
|
}
|
|
@@ -262,4 +253,4 @@ defineExpose({ tableRef });
|
|
|
262
253
|
display: flex;
|
|
263
254
|
justify-content: flex-end;
|
|
264
255
|
}
|
|
265
|
-
</style>
|
|
256
|
+
</style>
|