Commit 31227ba6 authored by 何远江's avatar 何远江

1

parent ce463b41
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
filterable filterable
placeholder="请选择" placeholder="请选择"
clearable clearable
@change="mapFieldChange"
> >
<el-option <el-option
v-for="itm in getSpecList" v-for="itm in getSpecList"
...@@ -181,45 +182,35 @@ onMounted(() => { ...@@ -181,45 +182,35 @@ onMounted(() => {
// isVariable.value = !!props.item.orderFiled?.variable // isVariable.value = !!props.item.orderFiled?.variable
}) })
watch( const mapFieldChange = (e) => {
() => props.item.mapField, if (e) {
(val) => { if (props.item.scripts?.length == 0) {
// 如果有值,添加脚本
if (val && props.item.scripts.length == 0) {
props.item.scripts.push({ props.item.scripts.push({
content: '', content: '',
scriptName: '' scriptName: ''
}) })
} }
} else {
props.item.scripts = []
props.item.orderFiled = null
} }
) }
const filterMapFieldChange = (e) => { const filterMapFieldChange = (e) => {
if (e) { if (e) {
props.item.filterMapFiled = e.filedName props.item.filterMapFiled = e.filedName
// console.log('匹配当前字段')
// // 找到匹配的过滤字段
// getFilterMapFieldsFlatList.value.some((items) => {
// if (items.filedName == e) {
// props.item.filterFiled = items
// return true
// }
// return false
// })
// 如果没有脚本,设置一个空的脚本 // 如果没有脚本,设置一个空的脚本
if (!props.item?.filterScripts || props.item?.filterScripts?.length == 0) { if (props.item.filterScripts?.length == 0) {
props.item.filterScripts = [ props.item.filterScripts.push({
{ content: '',
content: '', scriptName: ''
scriptName: '' })
}
]
} }
} else { } else {
// //
props.item.filterMapFiled = null
props.item.filterScripts = []
} }
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
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