Commit 5d98e76ed72be16420cf77c015f13635063c027d

Authored by fengtao
Committed by xp.Huang
1 parent 4bcf288b

fix(src/packages/components): 联动组件中的输入框组件,优化与其他组件进行联动进行搜索功能

@@ -34,12 +34,8 @@ export const useChartInteract = ( @@ -34,12 +34,8 @@ export const useChartInteract = (
34 if (groupItem.id === item.interactComponentId) { 34 if (groupItem.id === item.interactComponentId) {
35 const { Params, Header } = toRefs(groupItem.request.requestParams) 35 const { Params, Header } = toRefs(groupItem.request.requestParams)
36 Object.keys(item.interactFn).forEach(key => { 36 Object.keys(item.interactFn).forEach(key => {
37 - if (Params.value[key]) {  
38 Params.value[key] = param[item.interactFn[key]] 37 Params.value[key] = param[item.interactFn[key]]
39 - }  
40 - if (Header.value[key]) {  
41 Header.value[key] = param[item.interactFn[key]] 38 Header.value[key] = param[item.interactFn[key]]
42 - }  
43 }) 39 })
44 } 40 }
45 }) 41 })
@@ -56,8 +52,8 @@ export const useChartInteract = ( @@ -56,8 +52,8 @@ export const useChartInteract = (
56 } 52 }
57 // 53 //
58 Object.keys(item.interactFn).forEach(key => { 54 Object.keys(item.interactFn).forEach(key => {
59 - Params.value[key] = param[item.interactFn[key]]  
60 - Header.value[key] = param[item.interactFn[key]] 55 + Params.value[key] = decodeURIComponent(param[item.interactFn[key]])
  56 + Header.value[key] = param[item.interactFn[key]]
61 }) 57 })
62 } 58 }
63 } 59 }
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <n-input :style="`width:${w}px;`" type="text" 3 <n-input :style="`width:${w}px;`" type="text"
4 v-model:value="option.value.dataset" 4 v-model:value="option.value.dataset"
5 placeholder="请输入" 5 placeholder="请输入"
6 - @change="onChange"> 6 + @update="onChange">
7 7
8 </n-input> 8 </n-input>
9 </div> 9 </div>
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 import { PropType, toRefs, shallowReactive, watch } from 'vue' 13 import { PropType, toRefs, shallowReactive, watch } from 'vue'
14 import { CreateComponentType } from '@/packages/index.d' 14 import { CreateComponentType } from '@/packages/index.d'
15 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' 15 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
16 -import { useChartInteract } from '@/hooks' 16 +import { useChartInteract } from '@/hooks/external/useChartSelectInteract.hook'
17 import { InteractEventOn } from '@/enums/eventEnum' 17 import { InteractEventOn } from '@/enums/eventEnum'
18 import { ComponentInteractParamsEnum } from './interact' 18 import { ComponentInteractParamsEnum } from './interact'
19 19
@@ -33,12 +33,12 @@ const option = shallowReactive({ @@ -33,12 +33,12 @@ const option = shallowReactive({
33 }) 33 })
34 34
35 const onChange = (v: string) => { 35 const onChange = (v: string) => {
36 - if(v == undefined) return; 36 + // if(v == undefined) return;
37 // 存储到联动数据 37 // 存储到联动数据
38 useChartInteract( 38 useChartInteract(
39 props.chartConfig, 39 props.chartConfig,
40 useChartEditStore, 40 useChartEditStore,
41 - { [ComponentInteractParamsEnum.DATA]: v }, 41 + { [ComponentInteractParamsEnum.DATA]: encodeURIComponent(option.value.dataset) },
42 InteractEventOn.CHANGE 42 InteractEventOn.CHANGE
43 ) 43 )
44 } 44 }