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

bug 修改

parent 940c4680
...@@ -197,6 +197,12 @@ export const useVariableExcelChangeStore = defineStore('variableExcelChangeStore ...@@ -197,6 +197,12 @@ export const useVariableExcelChangeStore = defineStore('variableExcelChangeStore
getFilterMapFieldsList(): any { getFilterMapFieldsList(): any {
// 是否禁用 // 是否禁用
return this.filterMapField return this.filterMapField
},
getFilterMapFieldsFlatList(): any {
return this.filterMapField?.reduce((pre, cur) => {
pre.push(cur.filedPojos)
return pre
}, [])
} }
}, },
actions: { actions: {
......
...@@ -310,9 +310,12 @@ const confirmConfig = (configList: any) => { ...@@ -310,9 +310,12 @@ const confirmConfig = (configList: any) => {
variable: true variable: true
} }
} }
if (!item.filterMapFiled) {
item.filterMapFiled = null
}
return item return item
}) })
.filter((v) => !!v.mapField) .filter((v) => !!v.mapField && !!v.filterMapFiled)
) )
}) })
// 关闭popover // 关闭popover
......
...@@ -75,12 +75,12 @@ ...@@ -75,12 +75,12 @@
<el-col> <el-col>
<el-form-item label="过滤字段"> <el-form-item label="过滤字段">
<el-select <el-select
v-model="item.filterFiled" v-model="item.filterMapFiled"
style="width: 260px" style="width: 260px"
filterable filterable
placeholder="请选择" placeholder="请选择"
clearable clearable
value-key="filedName" @change="filterMapFieldChange"
> >
<el-option-group <el-option-group
v-for="group in getFilterMapFieldsList" v-for="group in getFilterMapFieldsList"
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
v-for="itm in group.filedPojos" v-for="itm in group.filedPojos"
:key="itm.filedName" :key="itm.filedName"
:label="itm.fliedTitle" :label="itm.fliedTitle"
:value="itm" :value="itm.filedName"
/> />
</el-option-group> </el-option-group>
</el-select> </el-select>
...@@ -154,7 +154,7 @@ import { onMounted, ref, watch } from 'vue' ...@@ -154,7 +154,7 @@ import { onMounted, ref, watch } from 'vue'
const props = defineProps<{ item?: any; index: number }>() const props = defineProps<{ item?: any; index: number }>()
const emits = defineEmits(['remove']) const emits = defineEmits(['remove'])
const excelChangeStore = useVariableExcelChangeStore() const excelChangeStore = useVariableExcelChangeStore()
const { getScriptList, getSpecList, getFilterMapFieldsList } = storeToRefs(excelChangeStore) const { getScriptList, getSpecList, getFilterMapFieldsList, getFilterMapFieldsFlatList } = storeToRefs(excelChangeStore)
const scriptChange = (sitem, e) => { const scriptChange = (sitem, e) => {
if (e) { if (e) {
...@@ -192,8 +192,22 @@ watch( ...@@ -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( watch(
() => props.item.filterFiled, () => props.item.filterMapFiled,
(val) => { (val) => {
if (!props.item?.filterScripts) { if (!props.item?.filterScripts) {
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