sh-view 2.7.9 → 2.8.1

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.
@@ -1,28 +1,46 @@
1
- import { computed, onBeforeMount, ref, watch } from 'vue'
1
+ import { computed, ref, watch } from 'vue'
2
2
 
3
- export default function (props, context, proxy) {
3
+ export default function (props, context, proxy, initRenderData) {
4
4
  const { $vUtils } = proxy
5
- const renderValue = ref({})
5
+
6
+ let renderOption = ref({})
6
7
 
7
8
  // 初始化
8
9
  const initData = () => {
9
10
  const { column, $panel } = props.rparams
10
11
  const option = column.filters[0]
11
- renderValue.value = option
12
- $panel.changeOption(null, Boolean(renderValue.value.data), option)
12
+ renderOption.value = option
13
+ $panel.changeOption(null, Boolean(renderOption.value.data), option)
14
+ }
15
+
16
+ // 过滤回调option
17
+ const vxeFilterChange = ({ value, $event }) => {
18
+ const { $panel } = props.rparams
19
+ $panel.changeOption(null, Boolean(renderOption.value.data), renderOption.value)
13
20
  }
14
- // 过滤回调
15
- const vxeFilterCallback = ({ value, $event }) => {
21
+
22
+ // 过滤确认
23
+ const vxeFilterConfirm = () => {
24
+ const { $panel } = props.rparams
25
+ $panel.confirmFilter()
26
+ }
27
+
28
+ // 过滤充值
29
+ const vxeFilterReset = () => {
16
30
  const { $panel } = props.rparams
17
- $panel.changeOption(null, Boolean(renderValue.value.data), renderValue.value)
31
+ $panel.resetFilter()
18
32
  }
19
33
 
20
- onBeforeMount(() => {
21
- initData()
22
- })
34
+ watch(
35
+ () => props.rkey,
36
+ () => (initRenderData ? initRenderData() : initData()),
37
+ { deep: true, immediate: true }
38
+ )
23
39
 
24
40
  return {
25
- renderValue,
26
- vxeFilterCallback
41
+ renderOption,
42
+ vxeFilterChange,
43
+ vxeFilterConfirm,
44
+ vxeFilterReset
27
45
  }
28
46
  }