@lambo-design/schema-paging-table 1.0.0-beta.48 → 1.0.0-beta.49
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 +2 -2
- package/src/index.vue +53 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/schema-paging-table",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"standard-version": "^9.5.0",
|
|
14
14
|
"@lambo-design/schema-form": "^1.0.0-beta.72",
|
|
15
|
-
"@lambo-design/paging-table": "^1.0.0-beta.
|
|
15
|
+
"@lambo-design/paging-table": "^1.0.0-beta.85",
|
|
16
16
|
"@lambo-design/shared": "^1.0.0-beta.220",
|
|
17
17
|
"@lambo-design/core": "^4.7.1-beta.145"
|
|
18
18
|
},
|
package/src/index.vue
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<LamboPagingTable
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
ref="schemaPagingTable"
|
|
4
|
+
:dataUrl="dataUrl"
|
|
5
|
+
:data="data"
|
|
6
|
+
:columns="tableColumn"
|
|
7
|
+
:autoSearch="autoSearch"
|
|
8
|
+
:searchParams="tableSearchParams"
|
|
9
|
+
:transformResponse="transformResponse"
|
|
10
|
+
:showTableOption="showTableOption"
|
|
11
|
+
:buttonFlex="buttonFlex"
|
|
12
|
+
:pageDisable="pageDisable"
|
|
13
|
+
:radioSelectIndex="radioSelectIndex"
|
|
14
|
+
@on-row-click="onRowClick"
|
|
15
|
+
@on-selection-change="onSelectionChange"
|
|
16
|
+
@on-select="onSelect"
|
|
17
|
+
@on-select-cancel="onSelectCancel"
|
|
18
|
+
@on-select-all="onSelectAll"
|
|
19
|
+
@on-select-all-cancel="onSelectAllCancel">
|
|
20
20
|
<div slot="search">
|
|
21
21
|
<LamboSchemaForm
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
ref="lamboSchemaForm"
|
|
23
|
+
v-model="queryForm"
|
|
24
|
+
:form-type="'search'"
|
|
25
|
+
:fieldList="formFields"
|
|
26
|
+
:labelWidth="labelWidth"
|
|
27
|
+
:default-rows="2"
|
|
28
|
+
:grid-columns="gridColumns"
|
|
29
|
+
:customComponents="customComponents"
|
|
30
|
+
:customValidates="customValidates"
|
|
31
|
+
@doSearch="doSearch" @reset="onReset"/>
|
|
32
32
|
<div v-if="rowName && selectTags.length > 0">
|
|
33
33
|
<Tag v-for="item in selectTags" :key="item.key" :name="item.key" closable @on-close="tagClose">
|
|
34
34
|
{{ item.value }}
|
|
@@ -38,9 +38,10 @@
|
|
|
38
38
|
无选中数据
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
<
|
|
41
|
+
<Row slot="buttons" type="flex" justify="space-between" :wrap="false">
|
|
42
|
+
<Col flex="auto" ref="container" :class="totalButtons.length > buttonsInFirstRow ? collapsed ? 'buttons-hidden' : '' : ''">
|
|
43
|
+
<Row type="flex" :justify="buttonFlex">
|
|
44
|
+
<Button
|
|
44
45
|
ref="buttons"
|
|
45
46
|
v-if="dropDownButton.length > 0"
|
|
46
47
|
v-for="(item,index) in dropDownButton"
|
|
@@ -50,17 +51,18 @@
|
|
|
50
51
|
v-permission="item.permission"
|
|
51
52
|
:key="index"
|
|
52
53
|
@click="doClick(item)"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
:class="buttonShowClass">
|
|
55
|
+
{{ item.name }}
|
|
56
|
+
</Button>
|
|
57
|
+
</Row>
|
|
58
|
+
</Col>
|
|
59
|
+
<Col flex="0 1 77px" v-if="totalButtons.length > buttonsInFirstRow">
|
|
60
|
+
<Button type="text" class="more-btn" @click=setCollapse>
|
|
59
61
|
{{collapsed ?'展开':'收起'}}
|
|
60
62
|
<Icon :type="collapsed ? 'ios-arrow-down' : 'ios-arrow-up'"></Icon>
|
|
61
63
|
</Button>
|
|
62
|
-
</
|
|
63
|
-
</
|
|
64
|
+
</Col>
|
|
65
|
+
</Row>
|
|
64
66
|
</LamboPagingTable>
|
|
65
67
|
</template>
|
|
66
68
|
<script>
|
|
@@ -294,18 +296,16 @@ export default {
|
|
|
294
296
|
})
|
|
295
297
|
return columns
|
|
296
298
|
},
|
|
297
|
-
// spreadButton: function () {
|
|
298
|
-
// return this.buttonList.slice(0,3)
|
|
299
|
-
// },
|
|
300
299
|
dropDownButton: function () {
|
|
301
|
-
// let list = [...this.buttonList,...this.buttonList]
|
|
302
|
-
// return list.splice(0,7)
|
|
303
300
|
return this.buttonList
|
|
304
301
|
},
|
|
305
302
|
multiSelect: function() {
|
|
306
303
|
return this.columnList.some((item)=>{
|
|
307
304
|
return item.type === "selection"
|
|
308
305
|
})
|
|
306
|
+
},
|
|
307
|
+
buttonShowClass(){
|
|
308
|
+
return 'buttons-show-'+this.buttonFlex
|
|
309
309
|
}
|
|
310
310
|
},
|
|
311
311
|
watch: {
|
|
@@ -351,10 +351,7 @@ export default {
|
|
|
351
351
|
calculateButtonsInFirstRow() {
|
|
352
352
|
let container = this.$refs.container
|
|
353
353
|
if (!container){return}
|
|
354
|
-
let containerWidth =
|
|
355
|
-
if (container.offsetWidth === undefined){
|
|
356
|
-
}
|
|
357
|
-
containerWidth = container.offsetWidth
|
|
354
|
+
let containerWidth = container.$el.offsetWidth
|
|
358
355
|
const buttons = this.$refs.buttons;
|
|
359
356
|
let totalWidth = 0;
|
|
360
357
|
let buttonsInFirstRow = 0;
|
|
@@ -369,7 +366,6 @@ export default {
|
|
|
369
366
|
this.totalButtons = this.dropDownButton
|
|
370
367
|
this.buttonsInFirstRow = buttonsInFirstRow;
|
|
371
368
|
},
|
|
372
|
-
|
|
373
369
|
setCollapse: function() {
|
|
374
370
|
this.collapsed = !this.collapsed
|
|
375
371
|
},
|
|
@@ -397,8 +393,8 @@ export default {
|
|
|
397
393
|
self.$router.push({ path: routeInfo.path, query })
|
|
398
394
|
} else {
|
|
399
395
|
const query = keysExist
|
|
400
|
-
|
|
401
|
-
|
|
396
|
+
? routeInfo.keys.reduce((acc, key) => ({ ...acc, [key]: selection[0][key] }), {})
|
|
397
|
+
: null;
|
|
402
398
|
self.$router.push({ path: routeInfo.path, query })
|
|
403
399
|
}
|
|
404
400
|
} else if (item.clickEvent?.type === "method") {
|
|
@@ -591,5 +587,12 @@ export default {
|
|
|
591
587
|
height:33px;
|
|
592
588
|
overflow: hidden;
|
|
593
589
|
}
|
|
590
|
+
|
|
591
|
+
.buttons-show-start:not(:last-child){
|
|
592
|
+
margin:0 5px 5px 0
|
|
593
|
+
}
|
|
594
|
+
.buttons-show-end:not(:first-child){
|
|
595
|
+
margin:0 0 5px 5px
|
|
596
|
+
}
|
|
594
597
|
</style>
|
|
595
598
|
|