Commit afdb080b by Tianqing Liu

feat: 批量操作功能,只有当前组的图片,可以选中

1 parent ba782d7f
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<!--批量操作--> <!--批量操作-->
<div class="multiple-operation"> <div class="multiple-operation">
<el-button type="text" @click="handleMutipleOperation"> <el-button type="text" @click="handleMutipleOperation(person)">
{{mutipleOperationText}} {{mutipleOperationText}}
<i class="el-icon-arrow-right el-icon--right"></i> <i class="el-icon-arrow-right el-icon--right"></i>
</el-button> </el-button>
...@@ -607,10 +607,14 @@ export default { ...@@ -607,10 +607,14 @@ export default {
// 批量操作 // 批量操作
const isMultipleOperation = ref(false) const isMultipleOperation = ref(false)
const handleMutipleOperation = () => { const currentMultipleGroupId = ref('') // 当前批量操作的组id
const handleMutipleOperation = (person) => {
isMultipleOperation.value = !isMultipleOperation.value isMultipleOperation.value = !isMultipleOperation.value
if (!isMultipleOperation.value) { if (!isMultipleOperation.value) {
selectedPersonList.value = [] selectedPersonList.value = []
currentMultipleGroupId.value = ''
} else {
currentMultipleGroupId.value = person.person_unid
} }
} }
const mutipleOperationText = computed(() => { const mutipleOperationText = computed(() => {
...@@ -730,9 +734,9 @@ export default { ...@@ -730,9 +734,9 @@ export default {
window.open(url) window.open(url)
} }
const handleClick = function(data, event){ const handleClick = function(data, event){
console.log('handleClick', event) console.log('handleClick', data, event)
// 多选 // 多选。只有设置为多选状态的组,才可以选中
if (isMultipleOperation.value) { if (isMultipleOperation.value && currentMultipleGroupId.value === data.person_unid) {
selectedPersonList.value.push(data) selectedPersonList.value.push(data)
} else { } else {
currentItemId.value = data.id currentItemId.value = data.id
...@@ -928,6 +932,7 @@ export default { ...@@ -928,6 +932,7 @@ export default {
mutipleOperationText, mutipleOperationText,
mutipleOperationDisabled, mutipleOperationDisabled,
deleteRealPersonRecord, deleteRealPersonRecord,
currentMultipleGroupId,
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!