sh-view 2.9.11 → 2.9.12

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": "sh-view",
3
- "version": "2.9.11",
3
+ "version": "2.9.12",
4
4
  "description": "基于vxe-table二次封装,更包含Alert,Badge,Card,CodeEditor,Col,Corner,CountTo,Drawer,Empty,Form,Header,Icon,List,Loading,Modal,Noticebar,Poptip,Progress,PullRefresh,Query,Result,Row,Split,Grid,Table,Tabs,Tag,Toolbar,Tree,Upload,WaterFall,WaterMark等丰富组件库",
5
5
  "main": "packages/index.js",
6
6
  "typings": "types/index.d.ts",
@@ -1,8 +1,10 @@
1
1
  <template>
2
2
  <vxe-table
3
3
  ref="tableRef"
4
+ v-resize="offetChangeDebounce"
4
5
  :class="{ 'sh-vxe-tree-table': true, 'is--hidecheck': globalConfig.checkHide }"
5
6
  v-bind="tableConfigIn"
7
+ :syncResize="syncResize"
6
8
  @radio-change="onRadioChange"
7
9
  @checkbox-change="onSelectionChange"
8
10
  @checkbox-all="onSelectionChange">
@@ -26,7 +28,6 @@
26
28
  import { defineComponent, computed, getCurrentInstance, ref, watch, onMounted } from 'vue'
27
29
  // 树组件表格默认配置
28
30
  const tableConfigDefault = {
29
- fit: true,
30
31
  autoResize: false,
31
32
  stripe: false,
32
33
  minHeight: 80,
@@ -55,6 +56,7 @@ export default defineComponent({
55
56
  const tableRef = ref()
56
57
  const filterData = ref(null)
57
58
  const treeValue = ref([])
59
+ const syncResize = ref(false)
58
60
 
59
61
  const checkWidth = computed(() => {
60
62
  return props.globalConfig.columns ? props.globalConfig?.defaultWidth || 150 : '100%'
@@ -186,8 +188,15 @@ export default defineComponent({
186
188
  }
187
189
  return $vUtils.get(row, column.property)
188
190
  }
191
+ const handleOffsetChange = () => {
192
+ syncResize.value = true
193
+ setTimeout(() => {
194
+ syncResize.value = false
195
+ })
196
+ }
189
197
 
190
198
  const filterChangeDebounce = $vUtils.debounce(handleMyTableFilter, 500)
199
+ const offetChangeDebounce = $vUtils.debounce(handleOffsetChange, tableConfigIn.value.resizeConfig?.refreshDelay || 100)
191
200
 
192
201
  watch(
193
202
  () => props.modelValue,
@@ -205,12 +214,15 @@ export default defineComponent({
205
214
 
206
215
  return {
207
216
  tableRef,
217
+ syncResize,
208
218
  checkWidth,
209
219
  tableConfigIn,
210
220
  onRadioChange,
211
221
  onSelectionChange,
212
222
  getTreeNodeCellContent,
213
- initSelection
223
+ getSelectionData,
224
+ initSelection,
225
+ offetChangeDebounce
214
226
  }
215
227
  }
216
228
  })