@truenewx/tnxvue3 3.0.2 → 3.0.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenewx/tnxvue3",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "互联网技术解决方案:Vue3扩展支持",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -25,7 +25,7 @@
25
25
  "vue-router": "~4.4.0"
26
26
  },
27
27
  "dependencies": {
28
- "@truenewx/tnxcore": "3.0.2",
28
+ "@truenewx/tnxcore": "3.0.3",
29
29
  "@element-plus/icons-vue": "2.3.1",
30
30
  "async-validator": "4.2.5",
31
31
  "mitt": "3.0.1"
@@ -1,16 +1,21 @@
1
1
  <template>
2
- <div class="tnxbsv-pagination" :class="'justify-content-' + align" v-if="paged">
3
- <div class="pagination-text">
4
- <span>每页</span>
5
- <Select v-model="pageSize" :items="pageSizeItems" v-if="pageSizeChangeable"/>
6
- <span class="mx-1" v-else>{{ pageSize }}</span>
7
- <span>条,共</span>
8
- <span class="mx-1">{{ paged.total }}</span>
9
- <span>条</span>
2
+ <div class="tnxbsv-paged" :class="'justify-content-' + align" v-if="value">
3
+ <div class="paged-text" v-if="showPageSize || showTotal">
4
+ <div class="page-size-wrapper" v-if="showPageSize">
5
+ <span>每页</span>
6
+ <Select v-model="pageSize" :items="pageSizeItems" v-if="pageSizeChangeable"/>
7
+ <span class="mx-1" v-else>{{ pageSize }}</span>
8
+ <span>条</span>
9
+ </div>
10
+ <div class="total-wrapper" v-if="showTotal">
11
+ <span>共</span>
12
+ <span class="mx-1">{{ value.total }}</span>
13
+ <span>条</span>
14
+ </div>
10
15
  </div>
11
16
  <BPagination v-model="pageNo"
12
- :total-rows="paged.total"
13
- :per-page="paged.pageSize"
17
+ :total-rows="value.total"
18
+ :per-page="value.pageSize"
14
19
  :aria-controls="ariaControls"
15
20
  :aria-label="ariaLabel"
16
21
  />
@@ -22,11 +27,19 @@ import {BPagination} from 'bootstrap-vue-next';
22
27
  import Select from '../select/Select.vue';
23
28
 
24
29
  export default {
25
- name: 'TnxbsvPagination',
30
+ name: 'TnxbsvPaged',
26
31
  components: {BPagination, Select},
27
32
  props: {
28
- paged: Object,
33
+ value: Object,
29
34
  pageSizeChangeable: Boolean,
35
+ showPageSize: {
36
+ type: Boolean,
37
+ default: true,
38
+ },
39
+ showTotal: {
40
+ type: Boolean,
41
+ default: true,
42
+ },
30
43
  align: {
31
44
  type: String,
32
45
  default: 'end', // start | center | end
@@ -37,8 +50,8 @@ export default {
37
50
  },
38
51
  data() {
39
52
  return {
40
- pageSize: this.paged?.pageSize || 20,
41
- pageNo: this.paged?.pageNo || 1,
53
+ pageSize: this.value?.pageSize || 20,
54
+ pageNo: this.value?.pageNo || 1,
42
55
  };
43
56
  },
44
57
  computed: {
@@ -77,26 +90,30 @@ export default {
77
90
  </script>
78
91
 
79
92
  <style>
80
- .tnxbsv-pagination {
93
+ .tnxbsv-paged {
81
94
  width: 100%;
82
95
  display: flex;
83
96
  align-items: center;
84
97
  }
85
98
 
86
- .tnxbsv-pagination .pagination-text {
99
+ .tnxbsv-paged .paged-text {
87
100
  display: flex;
88
101
  align-items: center;
89
102
  color: var(--bs-secondary-color);
90
- margin: 0 0.5rem;
91
103
  white-space: nowrap;
92
104
  }
93
105
 
94
- .tnxbsv-pagination .form-select {
106
+ .tnxbsv-paged .paged-text .page-size-wrapper,
107
+ .tnxbsv-paged .paged-text .total-wrapper {
108
+ margin-right: 0.5rem;
109
+ }
110
+
111
+ .tnxbsv-paged .form-select {
95
112
  width: 4.5rem;
96
113
  margin: 0 0.5rem;
97
114
  }
98
115
 
99
- .tnxbsv-pagination ul {
116
+ .tnxbsv-paged ul {
100
117
  margin-bottom: 0;
101
118
  }
102
119
  </style>
@@ -11,7 +11,7 @@
11
11
  <template #custom-foot>
12
12
  <tr>
13
13
  <td colspan="100%">
14
- <Pagination :paged="result.paged"
14
+ <Paged :value="result.paged"
15
15
  :query="query"
16
16
  :page-size-changeable="pageSizeChangeable"
17
17
  :aria-controls="id"
@@ -24,11 +24,11 @@
24
24
 
25
25
  <script>
26
26
  import {BTable} from 'bootstrap-vue-next';
27
- import Pagination from '../pagination/Pagination.vue';
27
+ import Paged from '../paged/Paged.vue';
28
28
 
29
29
  export default {
30
30
  name: 'TnxbsvQueryTable',
31
- components: {BTable, Pagination},
31
+ components: {BTable, Paged},
32
32
  props: {
33
33
  id: {
34
34
  type: String,
@@ -8,7 +8,7 @@ import './tnxbsv.css';
8
8
  import Button from './button/Button.vue';
9
9
  import EnumSelect from './enum-select/EnumSelect.vue';
10
10
  import Loading from './loading/Loading.vue';
11
- import Pagination from './pagination/Pagination.vue';
11
+ import Paged from './paged/Paged.vue';
12
12
  import QueryTable from './query-table/QueryTable.vue';
13
13
  import Select from './select/Select.vue';
14
14
 
@@ -16,7 +16,7 @@ export const build = tnxvue.build;
16
16
 
17
17
  export default build('tnxbsv', () => {
18
18
  const components = Object.assign({}, tnxvue.components, {
19
- Button, EnumSelect, Loading, Pagination, QueryTable, Select,
19
+ Button, EnumSelect, Loading, Paged, QueryTable, Select,
20
20
  });
21
21
 
22
22
  const tnxbsv = Object.assign({}, tnxvue, {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="tnxel-pagination-container"
2
+ <div class="tnxel-paged-wrapper"
3
3
  :class="{'justify-content-center': align === 'center', 'justify-content-end': align === 'right'}" v-if="model">
4
4
  <slot :paged="value" :change="change" :background="background">
5
5
  <el-pagination :layout="layout" :background="background"
@@ -79,16 +79,16 @@ export default {
79
79
  </script>
80
80
 
81
81
  <style>
82
- .tnxel-pagination-container {
82
+ .tnxel-paged-wrapper {
83
83
  display: flex;
84
84
  padding: 0.5rem 0;
85
85
  }
86
86
 
87
- .tnxel-pagination-container .el-pagination {
87
+ .tnxel-paged-wrapper .el-pagination {
88
88
  padding: 0;
89
89
  }
90
90
 
91
- .tnxel-pagination-container .el-pagination__page-size {
91
+ .tnxel-paged-wrapper .el-pagination__page-size {
92
92
  color: var(--el-text-color-regular);
93
93
  margin-right: 1rem;
94
94
  }