fix:用in判断对象是否具有某个特定的key,而不是value,解决当value为null时永远得不到修改

This commit is contained in:
dingxs 2023-06-19 14:39:00 +08:00
parent 80f06afa02
commit bc79e2f01f

View File

@ -30,10 +30,10 @@ export const useChartInteract = (
const { Params, Header } = toRefs(chartEditStore.requestGlobalConfig.requestDataPond[globalConfigPindAprndex].dataPondRequestConfig.requestParams)
Object.keys(item.interactFn).forEach(key => {
if (Params.value[key]) {
if (key in Params.value) {
Params.value[key] = param[item.interactFn[key]]
}
if (Header.value[key]) {
if (key in Header.value) {
Header.value[key] = param[item.interactFn[key]]
}
})
@ -43,10 +43,10 @@ export const useChartInteract = (
const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams)
Object.keys(item.interactFn).forEach(key => {
if (Params.value[key]) {
if (key in Params.value) {
Params.value[key] = param[item.interactFn[key]]
}
if (Header.value[key]) {
if (key in Header.value) {
Header.value[key] = param[item.interactFn[key]]
}
})