@bsgoal/common 2.13.1 → 2.13.4
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/dist/index.mjs +1610 -1607
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-search-table/index.vue +2 -8
- package/src/components/bsgoal-base-table/demo.vue +1 -1
- package/src/components/bsgoal-base-table/index.vue +14 -5
- package/src/components/bsgoal-base-table-pagination/index.vue +2 -13
- package/src/components/bsgoal-base-tree/index.vue +5 -6
- package/src/components/bsgoal-base-tree-table/demo.vue +29 -20
- package/src/components/bsgoal-base-tree-table/index.vue +4 -4
- package/src/components/bsgoal-base-select/debug.log +0 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-18 17:04:47
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-
|
|
5
|
+
* @LastEditTime: 2023-06-25 16:08:36
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-search-table\index.vue
|
|
7
7
|
* @Description: 查询+表格 基础组件
|
|
8
8
|
*
|
|
@@ -134,13 +134,6 @@ const props = defineProps({
|
|
|
134
134
|
})
|
|
135
135
|
|
|
136
136
|
|
|
137
|
-
// ---> S 注入分页的值 <---
|
|
138
|
-
const pageSizeValue = unref(props.pageSize)
|
|
139
|
-
if (pageSizeValue) {
|
|
140
|
-
provide('PAGINATION_PAGE_SIZE', ref(props.pageSize))
|
|
141
|
-
}
|
|
142
|
-
// ---> E 注入分页的值 <---
|
|
143
|
-
|
|
144
137
|
const transferFoldStatus = ref(false)
|
|
145
138
|
provide('transferFoldStatus', transferFoldStatus)
|
|
146
139
|
|
|
@@ -214,6 +207,7 @@ defineExpose({
|
|
|
214
207
|
<!-- S 表格 -->
|
|
215
208
|
<BsgoalBaseTable
|
|
216
209
|
ref="BSGOAL_BASE_TABLE_REF"
|
|
210
|
+
:page-size="pageSize"
|
|
217
211
|
:map-props="mapProps"
|
|
218
212
|
:operationWidth="operationWidth"
|
|
219
213
|
:config-options="tableOptions"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-10 11:29:04
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-
|
|
5
|
+
* @LastEditTime: 2023-06-25 16:04:16
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-table\index.vue
|
|
7
7
|
* @Description:
|
|
8
8
|
*
|
|
@@ -126,6 +126,13 @@ const props = defineProps({
|
|
|
126
126
|
hasPage: {
|
|
127
127
|
type: Boolean,
|
|
128
128
|
default: true
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* 每页显示条目个数
|
|
132
|
+
*/
|
|
133
|
+
pageSize: {
|
|
134
|
+
type: [Number],
|
|
135
|
+
default: 10
|
|
129
136
|
}
|
|
130
137
|
})
|
|
131
138
|
|
|
@@ -175,7 +182,7 @@ const mapPropsFuse = {
|
|
|
175
182
|
}
|
|
176
183
|
|
|
177
184
|
const currentPage = ref(1)
|
|
178
|
-
const
|
|
185
|
+
const curPageSize = ref(props.pageSize)
|
|
179
186
|
const total = ref(0)
|
|
180
187
|
const searchParams = ref({})
|
|
181
188
|
const tableLoading = ref(props.loading)
|
|
@@ -185,7 +192,7 @@ const ping = () => {
|
|
|
185
192
|
const { fetch, call, hasPage } = props
|
|
186
193
|
const searchParamsVal = searchParams.value
|
|
187
194
|
const currentPageVal = currentPage.value
|
|
188
|
-
const pageSizeVal =
|
|
195
|
+
const pageSizeVal = curPageSize.value
|
|
189
196
|
const fetchParams = { ...searchParamsVal }
|
|
190
197
|
// 显示分页的注入分页参数
|
|
191
198
|
if (hasPage) {
|
|
@@ -196,6 +203,7 @@ const ping = () => {
|
|
|
196
203
|
useFetch(fetch(fetchParams), call, tableLoading, resData)
|
|
197
204
|
}
|
|
198
205
|
|
|
206
|
+
|
|
199
207
|
watchEffect(() => {
|
|
200
208
|
tableData.value = props.data
|
|
201
209
|
})
|
|
@@ -222,10 +230,10 @@ const triggerPaginationCurrentChange = (current = 1) => {
|
|
|
222
230
|
}
|
|
223
231
|
//改变页数
|
|
224
232
|
const triggerPaginationSizeChange = (size = 10) => {
|
|
225
|
-
|
|
233
|
+
curPageSize.value = size
|
|
226
234
|
}
|
|
227
235
|
|
|
228
|
-
watch([currentPage,
|
|
236
|
+
watch([currentPage, curPageSize], () => {
|
|
229
237
|
ping()
|
|
230
238
|
})
|
|
231
239
|
|
|
@@ -311,6 +319,7 @@ defineExpose({
|
|
|
311
319
|
<BsgoalBaseTablePagination
|
|
312
320
|
v-if="hasPage"
|
|
313
321
|
:total="total"
|
|
322
|
+
:page-size="curPageSize"
|
|
314
323
|
@on-current-change="triggerPaginationCurrentChange"
|
|
315
324
|
@on-size-change="triggerPaginationSizeChange"
|
|
316
325
|
/>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-15 16:34:57
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-
|
|
5
|
+
* @LastEditTime: 2023-06-25 16:04:50
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-table-pagination\index.vue
|
|
7
7
|
* @Description: 表格的分页按钮
|
|
8
8
|
*
|
|
@@ -70,17 +70,6 @@ const triggerCurrentChange = (current = 1) => {
|
|
|
70
70
|
emits('on-current-change', current)
|
|
71
71
|
}
|
|
72
72
|
const page = ref(1)
|
|
73
|
-
|
|
74
|
-
const injectPageSize = inject('PAGINATION_PAGE_SIZE')
|
|
75
|
-
console.log('injectPageSize',injectPageSize);
|
|
76
|
-
// ---> S pageSize 值注入 <---
|
|
77
|
-
const pageSizeValueGet = computed(() => {
|
|
78
|
-
if (injectPageSize) {
|
|
79
|
-
return unref(injectPageSize)
|
|
80
|
-
}
|
|
81
|
-
return props.pageSize
|
|
82
|
-
})
|
|
83
|
-
// ---> E pageSize 值注入 <---
|
|
84
73
|
</script>
|
|
85
74
|
<template>
|
|
86
75
|
<div class="bsgoal-base-table-pagination">
|
|
@@ -91,7 +80,7 @@ const pageSizeValueGet = computed(() => {
|
|
|
91
80
|
layout="total, sizes, prev, pager, next, jumper"
|
|
92
81
|
v-model:current-page="page"
|
|
93
82
|
:page-sizes="pageSizes"
|
|
94
|
-
:page-size="
|
|
83
|
+
:page-size="pageSize"
|
|
95
84
|
:total="total"
|
|
96
85
|
@size-change="triggerSizeChange"
|
|
97
86
|
@current-change="triggerCurrentChange"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-21 08:43:33
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-25
|
|
5
|
+
* @LastEditTime: 2023-06-25 15:38:56
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-tree\index.vue
|
|
7
7
|
* @Description: 虚拟化树型结构 公共组件
|
|
8
8
|
*
|
|
@@ -55,7 +55,7 @@ const props = defineProps({
|
|
|
55
55
|
*/
|
|
56
56
|
lazyLoad: {
|
|
57
57
|
type: [Function],
|
|
58
|
-
default:
|
|
58
|
+
default: null
|
|
59
59
|
},
|
|
60
60
|
/**
|
|
61
61
|
* 初始化树节点
|
|
@@ -65,7 +65,7 @@ const props = defineProps({
|
|
|
65
65
|
*/
|
|
66
66
|
initNode: {
|
|
67
67
|
type: [Function],
|
|
68
|
-
default:
|
|
68
|
+
default: null
|
|
69
69
|
}
|
|
70
70
|
})
|
|
71
71
|
|
|
@@ -132,11 +132,10 @@ const loadNode = async (node, resolve, props) => {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
const lazyGet = computed(() => {
|
|
135
|
-
const {
|
|
136
|
-
if
|
|
135
|
+
const { lazyLoad = null , initNode = null} = props
|
|
136
|
+
if(lazyLoad && initNode ){
|
|
137
137
|
return true
|
|
138
138
|
}
|
|
139
|
-
|
|
140
139
|
return false
|
|
141
140
|
})
|
|
142
141
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-06-20 09:20:51
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-25
|
|
5
|
+
* @LastEditTime: 2023-06-25 16:29:16
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-tree-table\demo.vue
|
|
7
7
|
* @Description: 树 + 列表 + 演示
|
|
8
8
|
*
|
|
@@ -769,24 +769,29 @@ const triggerTreeAddClick = (params = '') => {
|
|
|
769
769
|
console.log('triggerTreeAddClick', params)
|
|
770
770
|
}
|
|
771
771
|
|
|
772
|
-
const treeData = ref([
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
772
|
+
const treeData = ref([])
|
|
773
|
+
|
|
774
|
+
setTimeout(() => {
|
|
775
|
+
treeData.value = ref([
|
|
776
|
+
{
|
|
777
|
+
label: 'label2-1',
|
|
778
|
+
isLeaf: true,
|
|
779
|
+
hasIcon: true
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
label: 'label2-2',
|
|
783
|
+
children: [
|
|
784
|
+
{
|
|
785
|
+
label: 'label2-2-1'
|
|
786
|
+
}
|
|
787
|
+
]
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
label: 'label2-3'
|
|
791
|
+
}
|
|
792
|
+
])
|
|
793
|
+
}, 5000)
|
|
794
|
+
|
|
790
795
|
const BSGOAL_BASE_TREE_TABLE_REF = ref(null)
|
|
791
796
|
const test = () => {
|
|
792
797
|
BSGOAL_BASE_TREE_TABLE_REF.value.refreshList({ prop: 111 })
|
|
@@ -809,7 +814,11 @@ const test = () => {
|
|
|
809
814
|
:expression="77"
|
|
810
815
|
@on-click-tree="triggerTreeClick"
|
|
811
816
|
@on-add-tree="triggerTreeAddClick"
|
|
812
|
-
|
|
817
|
+
>
|
|
818
|
+
<!-- <template #prop1="{row}">
|
|
819
|
+
<div>{{ row }}</div>
|
|
820
|
+
</template> -->
|
|
821
|
+
</BsgoalBaseTreeTable>
|
|
813
822
|
</div>
|
|
814
823
|
</div>
|
|
815
824
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-06-20 09:20:44
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-25
|
|
5
|
+
* @LastEditTime: 2023-06-25 16:28:00
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-tree-table\index.vue
|
|
7
7
|
* @Description: 树结构 + 列表
|
|
8
8
|
*
|
|
@@ -153,7 +153,7 @@ const props = defineProps({
|
|
|
153
153
|
*/
|
|
154
154
|
pageSize: {
|
|
155
155
|
type: [Number],
|
|
156
|
-
default:
|
|
156
|
+
default: 10
|
|
157
157
|
}
|
|
158
158
|
})
|
|
159
159
|
|
|
@@ -215,9 +215,9 @@ const tableStyler = computed(() => {
|
|
|
215
215
|
const styler = {}
|
|
216
216
|
const switchStatusValue = switchStatus.value
|
|
217
217
|
if (switchStatusValue) {
|
|
218
|
-
styler.
|
|
218
|
+
styler.minWidth = 'calc(100% - 250px)'
|
|
219
219
|
} else {
|
|
220
|
-
styler.
|
|
220
|
+
styler.minWidth = 'calc(100%)'
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
return styler
|