@lambo-design/schema-paging-table 1.0.0-beta.47 → 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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.vue +57 -51
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/schema-paging-table",
3
- "version": "1.0.0-beta.47",
3
+ "version": "1.0.0-beta.49",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -11,10 +11,10 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "standard-version": "^9.5.0",
14
- "@lambo-design/core": "^4.7.1-beta.145",
15
- "@lambo-design/shared": "^1.0.0-beta.220",
16
14
  "@lambo-design/schema-form": "^1.0.0-beta.72",
17
- "@lambo-design/paging-table": "^1.0.0-beta.84"
15
+ "@lambo-design/paging-table": "^1.0.0-beta.85",
16
+ "@lambo-design/shared": "^1.0.0-beta.220",
17
+ "@lambo-design/core": "^4.7.1-beta.145"
18
18
  },
19
19
  "scripts": {
20
20
  "release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
package/src/index.vue CHANGED
@@ -1,43 +1,47 @@
1
1
  <template>
2
2
  <LamboPagingTable
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">
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
- 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
- <div v-if="rowName">
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
+ <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 }}
35
35
  </Tag>
36
36
  </div>
37
+ <div v-else-if="rowName && selectTags.length === 0" style="height: 26px">
38
+ 无选中数据
39
+ </div>
37
40
  </div>
38
- <div slot="buttons" style="display: flex">
39
- <div ref="container" :class="totalButtons.length > buttonsInFirstRow ? collapsed ? 'buttons-hidden' : '' : ''" style="width: 100%">
40
- <Button
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
41
45
  ref="buttons"
42
46
  v-if="dropDownButton.length > 0"
43
47
  v-for="(item,index) in dropDownButton"
@@ -47,17 +51,18 @@
47
51
  v-permission="item.permission"
48
52
  :key="index"
49
53
  @click="doClick(item)"
50
- style="margin:0 5px 5px 0">
51
- {{ item.name }}
52
- </Button>
53
- </div>
54
- <div>
55
- <Button v-if="totalButtons.length > buttonsInFirstRow" type="text" class="more-btn" @click=setCollapse>
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>
56
61
  {{collapsed ?'展开':'收起'}}
57
62
  <Icon :type="collapsed ? 'ios-arrow-down' : 'ios-arrow-up'"></Icon>
58
63
  </Button>
59
- </div>
60
- </div>
64
+ </Col>
65
+ </Row>
61
66
  </LamboPagingTable>
62
67
  </template>
63
68
  <script>
@@ -291,18 +296,16 @@ export default {
291
296
  })
292
297
  return columns
293
298
  },
294
- // spreadButton: function () {
295
- // return this.buttonList.slice(0,3)
296
- // },
297
299
  dropDownButton: function () {
298
- // let list = [...this.buttonList,...this.buttonList]
299
- // return list.splice(0,7)
300
300
  return this.buttonList
301
301
  },
302
302
  multiSelect: function() {
303
303
  return this.columnList.some((item)=>{
304
304
  return item.type === "selection"
305
305
  })
306
+ },
307
+ buttonShowClass(){
308
+ return 'buttons-show-'+this.buttonFlex
306
309
  }
307
310
  },
308
311
  watch: {
@@ -348,10 +351,7 @@ export default {
348
351
  calculateButtonsInFirstRow() {
349
352
  let container = this.$refs.container
350
353
  if (!container){return}
351
- let containerWidth = ''
352
- if (container.offsetWidth === undefined){
353
- }
354
- containerWidth = container.offsetWidth
354
+ let containerWidth = container.$el.offsetWidth
355
355
  const buttons = this.$refs.buttons;
356
356
  let totalWidth = 0;
357
357
  let buttonsInFirstRow = 0;
@@ -366,7 +366,6 @@ export default {
366
366
  this.totalButtons = this.dropDownButton
367
367
  this.buttonsInFirstRow = buttonsInFirstRow;
368
368
  },
369
-
370
369
  setCollapse: function() {
371
370
  this.collapsed = !this.collapsed
372
371
  },
@@ -394,8 +393,8 @@ export default {
394
393
  self.$router.push({ path: routeInfo.path, query })
395
394
  } else {
396
395
  const query = keysExist
397
- ? routeInfo.keys.reduce((acc, key) => ({ ...acc, [key]: selection[0][key] }), {})
398
- : null;
396
+ ? routeInfo.keys.reduce((acc, key) => ({ ...acc, [key]: selection[0][key] }), {})
397
+ : null;
399
398
  self.$router.push({ path: routeInfo.path, query })
400
399
  }
401
400
  } else if (item.clickEvent?.type === "method") {
@@ -588,5 +587,12 @@ export default {
588
587
  height:33px;
589
588
  overflow: hidden;
590
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
+ }
591
597
  </style>
592
598