|
|
@ -59,6 +59,11 @@ const props = defineProps({ |
|
|
|
required: false, |
|
|
|
default: [] |
|
|
|
}, |
|
|
|
// true 取消父子关联; false 关联 |
|
|
|
isCheckStrictly:{ |
|
|
|
type:Boolean, |
|
|
|
default:false |
|
|
|
} |
|
|
|
}) |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
@ -285,11 +290,17 @@ const submitForm = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
const rowClick = (row: any, column: any, event: Event) => { |
|
|
|
|
|
|
|
const selected = searchTableRef.value?.elTableRef |
|
|
|
?.getSelectionRows() |
|
|
|
.some((item) => item.id === row.id) |
|
|
|
if (!selected) { |
|
|
|
searchTableRef.value?.elTableRef?.toggleRowSelection(row, true) |
|
|
|
if(props.isCheckStrictly&&row.children){//取消关联 |
|
|
|
row.children.forEach(item => { |
|
|
|
searchTableRef.value?.elTableRef?.toggleRowSelection(item, false) |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 取消 |
|
|
|
searchTableRef.value?.elTableRef?.toggleRowSelection(row, false) |
|
|
|