Commit 5d98e76ed72be16420cf77c015f13635063c027d
Committed by
xp.Huang
1 parent
4bcf288b
fix(src/packages/components): 联动组件中的输入框组件,优化与其他组件进行联动进行搜索功能
Showing
2 changed files
with
6 additions
and
10 deletions
... | ... | @@ -34,12 +34,8 @@ export const useChartInteract = ( |
34 | 34 | if (groupItem.id === item.interactComponentId) { |
35 | 35 | const { Params, Header } = toRefs(groupItem.request.requestParams) |
36 | 36 | Object.keys(item.interactFn).forEach(key => { |
37 | - if (Params.value[key]) { | |
38 | 37 | Params.value[key] = param[item.interactFn[key]] |
39 | - } | |
40 | - if (Header.value[key]) { | |
41 | 38 | Header.value[key] = param[item.interactFn[key]] |
42 | - } | |
43 | 39 | }) |
44 | 40 | } |
45 | 41 | }) |
... | ... | @@ -56,8 +52,8 @@ export const useChartInteract = ( |
56 | 52 | } |
57 | 53 | // |
58 | 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 | 3 | <n-input :style="`width:${w}px;`" type="text" |
4 | 4 | v-model:value="option.value.dataset" |
5 | 5 | placeholder="请输入" |
6 | - @change="onChange"> | |
6 | + @update="onChange"> | |
7 | 7 | |
8 | 8 | </n-input> |
9 | 9 | </div> |
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | import { PropType, toRefs, shallowReactive, watch } from 'vue' |
14 | 14 | import { CreateComponentType } from '@/packages/index.d' |
15 | 15 | import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' |
16 | -import { useChartInteract } from '@/hooks' | |
16 | +import { useChartInteract } from '@/hooks/external/useChartSelectInteract.hook' | |
17 | 17 | import { InteractEventOn } from '@/enums/eventEnum' |
18 | 18 | import { ComponentInteractParamsEnum } from './interact' |
19 | 19 | |
... | ... | @@ -33,12 +33,12 @@ const option = shallowReactive({ |
33 | 33 | }) |
34 | 34 | |
35 | 35 | const onChange = (v: string) => { |
36 | - if(v == undefined) return; | |
36 | + // if(v == undefined) return; | |
37 | 37 | // 存储到联动数据 |
38 | 38 | useChartInteract( |
39 | 39 | props.chartConfig, |
40 | 40 | useChartEditStore, |
41 | - { [ComponentInteractParamsEnum.DATA]: v }, | |
41 | + { [ComponentInteractParamsEnum.DATA]: encodeURIComponent(option.value.dataset) }, | |
42 | 42 | InteractEventOn.CHANGE |
43 | 43 | ) |
44 | 44 | } | ... | ... |