|
|
@@ -10,7 +10,7 @@
|
|
|
<div class="main">
|
|
|
<!-- 头部的总计和移动按钮 -->
|
|
|
<div class="statistics">
|
|
|
- <el-checkbox v-model="checkedAll">共{{ total }}项</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkedAll" @change="checkAllChange">共{{ props.scannerFiles.length }}项</el-checkbox>
|
|
|
<div class="">
|
|
|
<el-button color="#2E6BC8" @click="toSave">
|
|
|
<img src="@/assets/images/folder_white.png" alt="" /> 移动到
|
|
|
@@ -22,7 +22,7 @@
|
|
|
<div v-for="item in props.scannerFiles" :key="item" class="one_box">
|
|
|
<img :src="wangzhi + item.path" alt="" />
|
|
|
<div class="top_check">
|
|
|
- <el-checkbox @change="checkChange(item)"></el-checkbox>
|
|
|
+ <el-checkbox :checked="fileArr.some(par=>par == item.q)" @change="checkChange(item)"></el-checkbox>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -68,8 +68,24 @@ const checkChange = (item)=>{
|
|
|
}else{
|
|
|
arr.push(item.q)
|
|
|
}
|
|
|
+ // 判断全选
|
|
|
+ if(arr.length == props.scannerFiles.length){
|
|
|
+ checkedAll.value = true
|
|
|
+ }else{
|
|
|
+ checkedAll.value = false
|
|
|
+ }
|
|
|
fileArr.value = JSON.parse(JSON.stringify(arr))
|
|
|
- // console.log('fileArr',toRaw(fileArr.value));
|
|
|
+ console.log('fileArr',toRaw(fileArr.value));
|
|
|
+}
|
|
|
+const checkAllChange = ()=>{
|
|
|
+ console.log('checkedAll.value',checkedAll.value);
|
|
|
+ fileArr.value = []
|
|
|
+ if(checkedAll.value){ //全选
|
|
|
+ props.scannerFiles.forEach(item=>{
|
|
|
+ fileArr.value.push(item.q)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log('fileArr',fileArr.value);
|
|
|
}
|
|
|
const toSave = ()=>{
|
|
|
emit('saveScanFile',toRaw(fileArr.value))
|