Commit 448fa6ba authored by 何远江's avatar 何远江

bug 修改

parent 940c4680
......@@ -197,6 +197,12 @@ export const useVariableExcelChangeStore = defineStore('variableExcelChangeStore
getFilterMapFieldsList(): any {
// 是否禁用
return this.filterMapField
},
getFilterMapFieldsFlatList(): any {
return this.filterMapField?.reduce((pre, cur) => {
pre.push(cur.filedPojos)
return pre
}, [])
}
},
actions: {
......
......@@ -310,9 +310,12 @@ const confirmConfig = (configList: any) => {
variable: true
}
}
if (!item.filterMapFiled) {
item.filterMapFiled = null
}
return item
})
.filter((v) => !!v.mapField)
.filter((v) => !!v.mapField && !!v.filterMapFiled)
)
})
// 关闭popover
......
......@@ -75,12 +75,12 @@
<el-col>
<el-form-item label="过滤字段">
<el-select
v-model="item.filterFiled"
v-model="item.filterMapFiled"
style="width: 260px"
filterable
placeholder="请选择"
clearable
value-key="filedName"
@change="filterMapFieldChange"
>
<el-option-group
v-for="group in getFilterMapFieldsList"
......@@ -91,7 +91,7 @@
v-for="itm in group.filedPojos"
:key="itm.filedName"
:label="itm.fliedTitle"
:value="itm"
:value="itm.filedName"
/>
</el-option-group>
</el-select>
......@@ -154,7 +154,7 @@ import { onMounted, ref, watch } from 'vue'
const props = defineProps<{ item?: any; index: number }>()
const emits = defineEmits(['remove'])
const excelChangeStore = useVariableExcelChangeStore()
const { getScriptList, getSpecList, getFilterMapFieldsList } = storeToRefs(excelChangeStore)
const { getScriptList, getSpecList, getFilterMapFieldsList, getFilterMapFieldsFlatList } = storeToRefs(excelChangeStore)
const scriptChange = (sitem, e) => {
if (e) {
......@@ -192,8 +192,22 @@ watch(
}
)
const filterMapFieldChange = (e) => {
if (e) {
getFilterMapFieldsFlatList.value.some((items) => {
if (items.filedName == e) {
props.item.filterFiled = items
return true
}
return false
})
} else {
props.item.filterFiled = null
}
}
watch(
() => props.item.filterFiled,
() => props.item.filterMapFiled,
(val) => {
if (!props.item?.filterScripts) {
props.item.filterScripts = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment