leisure-core 0.5.23 → 0.5.24
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/le-list/src/main.vue +64 -21
- package/package.json +1 -1
package/le-list/src/main.vue
CHANGED
|
@@ -5,23 +5,49 @@
|
|
|
5
5
|
<el-form-item>
|
|
6
6
|
<slot></slot>
|
|
7
7
|
<le-button type="primary" @click="onClickQuery()">查询</le-button>
|
|
8
|
-
<le-button type="primary" @click="addItem()" v-if="isDispAddBtn"
|
|
8
|
+
<le-button type="primary" @click="addItem()" v-if="isDispAddBtn">{{
|
|
9
|
+
addBtnText
|
|
10
|
+
}}</le-button>
|
|
9
11
|
<slot name="headerBtns" :params="searchData"></slot>
|
|
10
12
|
</el-form-item>
|
|
11
13
|
</el-form>
|
|
12
|
-
<el-table
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
<el-table
|
|
15
|
+
ref="eltablemain"
|
|
16
|
+
:max-height="elTableMaxHeight"
|
|
17
|
+
:data="tableData"
|
|
18
|
+
border
|
|
19
|
+
:row-key="rowId"
|
|
20
|
+
:header-cell-style="{ 'text-align': 'center' }"
|
|
21
|
+
:cell-style="{ 'text-align': 'center' }"
|
|
22
|
+
stripe
|
|
23
|
+
style="width: 100%"
|
|
24
|
+
reserve-selection
|
|
25
|
+
@selection-change="handleSelectionChange"
|
|
26
|
+
>
|
|
15
27
|
<el-table-column type="selection" v-if="showChecked" width="55" />
|
|
16
|
-
<el-table-column
|
|
17
|
-
|
|
28
|
+
<el-table-column
|
|
29
|
+
v-for="column in tableColumns"
|
|
30
|
+
show-overflow-tooltip
|
|
31
|
+
:key="column.prop"
|
|
32
|
+
:prop="column.prop"
|
|
33
|
+
:label="column.label"
|
|
34
|
+
:width="column.width"
|
|
35
|
+
>
|
|
18
36
|
<template #default="scope">
|
|
19
37
|
<!-- <span v-html="renderColumnContent(column, scope)"></span> -->
|
|
20
|
-
<component
|
|
38
|
+
<component
|
|
39
|
+
:is="renderColumnContent(column)"
|
|
40
|
+
v-bind="getComponentProps(column, scope)"
|
|
41
|
+
></component>
|
|
21
42
|
</template>
|
|
22
43
|
</el-table-column>
|
|
23
44
|
<slot name="extColumn"></slot>
|
|
24
|
-
<el-table-column
|
|
45
|
+
<el-table-column
|
|
46
|
+
fixed="right"
|
|
47
|
+
label="操作"
|
|
48
|
+
:width="btnCellWidht"
|
|
49
|
+
align="center"
|
|
50
|
+
>
|
|
25
51
|
<template slot-scope="scope">
|
|
26
52
|
<template v-if="$scopedSlots.rowAllBtns">
|
|
27
53
|
<slot name="rowAllBtns" :rowItem="scope.row"></slot>
|
|
@@ -29,10 +55,14 @@
|
|
|
29
55
|
<template v-else>
|
|
30
56
|
<div class="rowBtns">
|
|
31
57
|
<le-button @click="editItem(scope.row)" v-if="disBtn === 'edit'">
|
|
32
|
-
编辑</le-button
|
|
58
|
+
编辑</le-button
|
|
59
|
+
>
|
|
33
60
|
<le-button @click="detail(scope.row)" v-if="disBtn === 'detail'">
|
|
34
|
-
详情</le-button
|
|
35
|
-
|
|
61
|
+
详情</le-button
|
|
62
|
+
>
|
|
63
|
+
<le-button-msg @click="del(scope.row.id)" v-if="isDispDelBtn"
|
|
64
|
+
>删除</le-button-msg
|
|
65
|
+
>
|
|
36
66
|
<div class="rowBtnsExt">
|
|
37
67
|
<slot name="rowBtns" :scope="scope"></slot>
|
|
38
68
|
</div>
|
|
@@ -42,11 +72,21 @@
|
|
|
42
72
|
</el-table-column>
|
|
43
73
|
</el-table>
|
|
44
74
|
<div style="text-align: center; margin-top: 30px">
|
|
45
|
-
<el-pagination
|
|
46
|
-
|
|
75
|
+
<el-pagination
|
|
76
|
+
background
|
|
77
|
+
layout="prev, pager, next"
|
|
78
|
+
:current-page="searchData.pageNo"
|
|
79
|
+
:total="searchData.total"
|
|
80
|
+
:page-size="searchData.pageSize"
|
|
81
|
+
@current-change="current_change"
|
|
82
|
+
>
|
|
47
83
|
</el-pagination>
|
|
48
84
|
</div>
|
|
49
|
-
<le-dialog-container
|
|
85
|
+
<le-dialog-container
|
|
86
|
+
:title="dialogTitle"
|
|
87
|
+
:width="dialogWidth"
|
|
88
|
+
:showDialog="showDialog"
|
|
89
|
+
>
|
|
50
90
|
<slot name="sub" v-if="showDialog" :rowItem="toparam"></slot>
|
|
51
91
|
</le-dialog-container>
|
|
52
92
|
</div>
|
|
@@ -76,12 +116,16 @@ export default {
|
|
|
76
116
|
},
|
|
77
117
|
searchParam: {
|
|
78
118
|
type: Object,
|
|
79
|
-
default: () => {
|
|
119
|
+
default: () => {},
|
|
80
120
|
},
|
|
81
121
|
isDispAddBtn: {
|
|
82
122
|
type: Boolean,
|
|
83
123
|
default: true,
|
|
84
124
|
},
|
|
125
|
+
addBtnText: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: "新建",
|
|
128
|
+
},
|
|
85
129
|
isDispDelBtn: {
|
|
86
130
|
type: Boolean,
|
|
87
131
|
default: false,
|
|
@@ -100,12 +144,12 @@ export default {
|
|
|
100
144
|
},
|
|
101
145
|
showChecked: {
|
|
102
146
|
type: Boolean,
|
|
103
|
-
default: false
|
|
147
|
+
default: false,
|
|
104
148
|
},
|
|
105
149
|
rowId: {
|
|
106
150
|
type: String,
|
|
107
|
-
default:
|
|
108
|
-
}
|
|
151
|
+
default: "id",
|
|
152
|
+
},
|
|
109
153
|
},
|
|
110
154
|
watch: {
|
|
111
155
|
searchParam: {
|
|
@@ -151,12 +195,11 @@ export default {
|
|
|
151
195
|
},
|
|
152
196
|
computed: {
|
|
153
197
|
toparam() {
|
|
154
|
-
if (this.showChecked)
|
|
155
|
-
return this.rowItems;
|
|
198
|
+
if (this.showChecked) return this.rowItems;
|
|
156
199
|
else {
|
|
157
200
|
return this.rowItem;
|
|
158
201
|
}
|
|
159
|
-
}
|
|
202
|
+
},
|
|
160
203
|
},
|
|
161
204
|
created() {
|
|
162
205
|
EventBus.$on("closeDialog", this.closeDialog);
|