leisure-core 0.5.5 → 0.5.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/le-dialog-container/src/main.vue +5 -15
- package/le-list/src/main.vue +35 -5
- package/package.json +1 -1
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
:
|
|
4
|
-
:title="title"
|
|
5
|
-
:visible.sync="dialogShow"
|
|
6
|
-
:close-on-click-modal="closeMode"
|
|
7
|
-
:show-close="showCloseBtnTop"
|
|
8
|
-
append-to-body
|
|
9
|
-
@close="closeDialog"
|
|
10
|
-
v-el-drag-dialog
|
|
11
|
-
>
|
|
2
|
+
<el-dialog :width="width" :title="title" :visible.sync="dialogShow" :close-on-click-modal="closeMode"
|
|
3
|
+
:show-close="showCloseBtnTop" append-to-body @close="closeDialog" v-el-drag-dialog>
|
|
12
4
|
<slot v-if="dialogShow" />
|
|
13
5
|
<div slot="footer" v-if="showFooter" class="dialog-footer">
|
|
14
6
|
<template>
|
|
@@ -16,9 +8,7 @@
|
|
|
16
8
|
<le-button type="primary" v-if="showSaveBtn" @click="saveData">{{
|
|
17
9
|
saveBtnText
|
|
18
10
|
}}</le-button>
|
|
19
|
-
<le-button type="info" v-if="showCloseBtn" @click="closeDialog"
|
|
20
|
-
>关闭</le-button
|
|
21
|
-
>
|
|
11
|
+
<le-button type="info" v-if="showCloseBtn" @click="closeDialog">关闭</le-button>
|
|
22
12
|
</template>
|
|
23
13
|
</div>
|
|
24
14
|
</el-dialog>
|
|
@@ -57,7 +47,7 @@ export default {
|
|
|
57
47
|
},
|
|
58
48
|
showCloseBtnTop: {
|
|
59
49
|
type: Boolean,
|
|
60
|
-
default:
|
|
50
|
+
default: false,
|
|
61
51
|
},
|
|
62
52
|
saveBtnText: {
|
|
63
53
|
type: String,
|
|
@@ -77,7 +67,7 @@ export default {
|
|
|
77
67
|
},
|
|
78
68
|
},
|
|
79
69
|
},
|
|
80
|
-
mounted() {},
|
|
70
|
+
mounted() { },
|
|
81
71
|
methods: {
|
|
82
72
|
closeDialog(param) {
|
|
83
73
|
this.$emit("close", param);
|
package/le-list/src/main.vue
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
<slot name="headerBtns" :params="searchData"></slot>
|
|
10
10
|
</el-form-item>
|
|
11
11
|
</el-form>
|
|
12
|
-
<el-table ref="eltablemain" :max-height="elTableMaxHeight" :data="tableData" border row-key="
|
|
12
|
+
<el-table ref="eltablemain" :max-height="elTableMaxHeight" :data="tableData" border :row-key="rowId"
|
|
13
13
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }" stripe
|
|
14
|
-
style="width: 100%">
|
|
14
|
+
style="width: 100%" reserve-selection @selection-change="handleSelectionChange">
|
|
15
|
+
<el-table-column type="selection" v-if="showChecked" width="55" />
|
|
15
16
|
<el-table-column v-for="column in tableColumns" show-overflow-tooltip :key="column.prop" :prop="column.prop"
|
|
16
17
|
:label="column.label" :width="column.width">
|
|
17
18
|
<template #default="scope">
|
|
@@ -19,10 +20,11 @@
|
|
|
19
20
|
<component :is="renderColumnContent(column)" v-bind="getComponentProps(column, scope)"></component>
|
|
20
21
|
</template>
|
|
21
22
|
</el-table-column>
|
|
23
|
+
<slot name="extColumn"></slot>
|
|
22
24
|
<el-table-column fixed="right" label="操作" :width="btnCellWidht" align="center">
|
|
23
25
|
<template slot-scope="scope">
|
|
24
26
|
<template v-if="$scopedSlots.rowAllBtns">
|
|
25
|
-
<slot name="rowAllBtns" :
|
|
27
|
+
<slot name="rowAllBtns" :rowItem="scope.row"></slot>
|
|
26
28
|
</template>
|
|
27
29
|
<template v-else>
|
|
28
30
|
<div class="rowBtns">
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
</el-pagination>
|
|
46
48
|
</div>
|
|
47
49
|
<le-dialog-container :title="dialogTitle" :width="dialogWidth" :showDialog="showDialog">
|
|
48
|
-
<slot name="sub" v-if="showDialog" :rowItem="
|
|
50
|
+
<slot name="sub" v-if="showDialog" :rowItem="toparam"></slot>
|
|
49
51
|
</le-dialog-container>
|
|
50
52
|
</div>
|
|
51
53
|
</template>
|
|
@@ -96,6 +98,14 @@ export default {
|
|
|
96
98
|
type: String,
|
|
97
99
|
default: "edit",
|
|
98
100
|
},
|
|
101
|
+
showChecked: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false
|
|
104
|
+
},
|
|
105
|
+
rowId: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: 'id',
|
|
108
|
+
}
|
|
99
109
|
},
|
|
100
110
|
watch: {
|
|
101
111
|
searchParam: {
|
|
@@ -114,6 +124,7 @@ export default {
|
|
|
114
124
|
data() {
|
|
115
125
|
return {
|
|
116
126
|
rowItem: {},
|
|
127
|
+
rowItems: [],
|
|
117
128
|
searchData: {
|
|
118
129
|
pageNo: 1,
|
|
119
130
|
total: 1,
|
|
@@ -138,7 +149,15 @@ export default {
|
|
|
138
149
|
},
|
|
139
150
|
};
|
|
140
151
|
},
|
|
141
|
-
computed: {
|
|
152
|
+
computed: {
|
|
153
|
+
toparam() {
|
|
154
|
+
if (this.showChecked)
|
|
155
|
+
return this.rowItems;
|
|
156
|
+
else {
|
|
157
|
+
return this.rowItem;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
142
161
|
created() {
|
|
143
162
|
EventBus.$on("closeDialog", this.closeDialog);
|
|
144
163
|
},
|
|
@@ -186,6 +205,14 @@ export default {
|
|
|
186
205
|
this.getList();
|
|
187
206
|
});
|
|
188
207
|
},
|
|
208
|
+
customItem(rowData) {
|
|
209
|
+
this.handleStatus = 2;
|
|
210
|
+
if (rowData) {
|
|
211
|
+
this.rowItem = rowData;
|
|
212
|
+
}
|
|
213
|
+
this.$emit("handleStatus", this.handleStatus);
|
|
214
|
+
this.showDialog = true;
|
|
215
|
+
},
|
|
189
216
|
editItem(row) {
|
|
190
217
|
this.handleStatus = 2;
|
|
191
218
|
this.$emit("handleStatus", this.handleStatus);
|
|
@@ -208,6 +235,9 @@ export default {
|
|
|
208
235
|
closeDialog() {
|
|
209
236
|
this.showDialog = false;
|
|
210
237
|
},
|
|
238
|
+
handleSelectionChange(val) {
|
|
239
|
+
this.rowItems = val;
|
|
240
|
+
},
|
|
211
241
|
format(type, value) {
|
|
212
242
|
const renderers = {
|
|
213
243
|
bool: () => (value == 1 ? "是" : "否"),
|