@bsgoal/common 2.13.0 → 2.13.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": "@bsgoal/common",
3
- "version": "2.13.0",
3
+ "version": "2.13.3",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -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 10:05:14
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 { treeData = [] } = props
136
- if (!treeData || !treeData.length) {
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 10:06:54
5
+ * @LastEditTime: 2023-06-25 15:32:25
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree-table\demo.vue
7
7
  * @Description: 树 + 列表 + 演示
8
8
  *
@@ -23,7 +23,7 @@ const props = defineProps({})
23
23
  // ---> S 树 <---
24
24
 
25
25
  const triggerTreeClick = (value, node, treeNode, event) => {
26
- console.log('triggerTreeClick =========================');
26
+ console.log('triggerTreeClick =========================')
27
27
  console.log('value', value)
28
28
  console.log('node', node)
29
29
  console.log('treeNode', treeNode)
@@ -769,37 +769,46 @@ const triggerTreeAddClick = (params = '') => {
769
769
  console.log('triggerTreeAddClick', params)
770
770
  }
771
771
 
772
- const treeData = ref([
773
- {
774
- label: 'label2-1',
775
- isLeaf: true,
776
- hasIcon: true
777
- },
778
- {
779
- label: 'label2-2',
780
- children: [
781
- {
782
- label: 'label2-2-1'
783
- }
784
- ]
785
- },
786
- {
787
- label: 'label2-3'
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
+
795
+ const BSGOAL_BASE_TREE_TABLE_REF = ref(null)
796
+ const test = () => {
797
+ BSGOAL_BASE_TREE_TABLE_REF.value.refreshList({ prop: 111 })
798
+ }
790
799
 
791
800
  // ---> E 列表 <---
792
801
  </script>
793
802
  <template>
794
803
  <div class="bsgoal-base-tree-table-demo">
795
804
  <div class="base_tree_table_demo">
805
+ <!-- <div @click="test">点击</div> -->
796
806
  <BsgoalBaseTreeTable
807
+ ref="BSGOAL_BASE_TREE_TABLE_REF"
797
808
  selection
798
809
  operation
799
810
  :tree-data="treeData"
800
811
  :page-size="40"
801
- :lazy-load="treeLazyLoad"
802
- :init-node="treeInitNode"
803
812
  :fetch="fetch"
804
813
  :config-options="configOptions"
805
814
  :expression="77"
@@ -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 09:52:47
5
+ * @LastEditTime: 2023-06-25 15:20:18
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree-table\index.vue
7
7
  * @Description: 树结构 + 列表
8
8
  *
@@ -197,6 +197,20 @@ const triggerTreeClick = (value, node, treeNode, event) => {
197
197
 
198
198
  // ---> E 树 <---
199
199
 
200
+ // ---> S 表 <---
201
+ const BSGOAL_BASE_SEARCH_TABLE_REF = ref(null)
202
+ const refreshList = (params = {}) => {
203
+ console.log('params',params);
204
+ BSGOAL_BASE_SEARCH_TABLE_REF.value.refreshList(params)
205
+ }
206
+
207
+ // 暴露的属性
208
+ defineExpose({
209
+ refreshList
210
+ })
211
+
212
+ // ---> E 表 <---
213
+
200
214
  const tableStyler = computed(() => {
201
215
  const styler = {}
202
216
  const switchStatusValue = switchStatus.value
@@ -225,7 +239,7 @@ const tableStyler = computed(() => {
225
239
  </div>
226
240
  <div class="base_tree_table--table" :style="tableStyler">
227
241
  <!-- S 列表 -->
228
- <BsgoalBaseSearchTable v-bind="$props">
242
+ <BsgoalBaseSearchTable ref="BSGOAL_BASE_SEARCH_TABLE_REF" v-bind="$props">
229
243
  <template v-for="slotName of slotNames" v-slot:[slotName]="{ row = {} }">
230
244
  <slot :name="slotName" :row="row"></slot>
231
245
  </template>