Commit ce03abfe authored by zhengke's avatar zhengke

云盘

parent ea30d796
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="CloudDisk-R-Center row"> <div class="CloudDisk-R-Center row">
<template v-for="(item,index) in dataList"> <template v-for="(item,index) in dataList">
<div style="position: relative;"> <div style="position: relative;">
<el-checkbox style="position: absolute;left: 30px;top: -3px;" <el-checkbox style="position: absolute;left: 30px;top: 0px;"
class="fz14" label="" v-model="item.check" class="fz14" label="" v-model="item.check"
@change="handleSelectionChange(item)"/> @change="handleSelectionChange(item)"/>
<el-dropdown trigger="click"> <el-dropdown trigger="click">
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref, watch } from "vue";
import CloudDiskService from "@/services/CloudDiskService"; import CloudDiskService from "@/services/CloudDiskService";
import { ApiResult } from "@/configs/axios"; import { ApiResult } from "@/configs/axios";
const props = defineProps({ const props = defineProps({
...@@ -132,20 +132,26 @@ ...@@ -132,20 +132,26 @@
emit('deleteImg',item) emit('deleteImg',item)
} }
watch(()=>props,(n,o)=>{
if(n.Parent.SelectedDatas.length==0) multipleSelection.value = []
},{
deep: true,
immediate:true
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.CloudDisk-R-Center{ .CloudDisk-R-Center{
flex-wrap: wrap; flex-wrap: wrap;
} }
.CloudDisk-R-Box{ .CloudDisk-R-Box{
width: 87px; width: 247px;
margin-left: 24px; margin-left: 24px;
margin-bottom: 24px; margin-bottom: 24px;
position: relative; position: relative;
} }
.CloudDisk-R-Box.active .CloudDisk-R-Img{ .CloudDisk-R-Box.active .CloudDisk-R-Img{
width: 85px; width: 247px;
height: 85px; height: 247px;
background: #8790F3; background: #8790F3;
box-shadow: 0px 0px 13px 0px #0D3EBC; box-shadow: 0px 0px 13px 0px #0D3EBC;
border-radius: 8px; border-radius: 8px;
...@@ -170,8 +176,8 @@ ...@@ -170,8 +176,8 @@
display: block; display: block;
} }
.CloudDisk-R-Img{ .CloudDisk-R-Img{
width: 85px; width: 247px;
height: 85px; height: 247px;
margin-bottom: 9px; margin-bottom: 9px;
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
...@@ -181,10 +187,10 @@ ...@@ -181,10 +187,10 @@
} }
.CloudDisk-R-Img .el-image{ .CloudDisk-R-Img .el-image{
width: 85px; width: 247px;
} }
.title{ .title{
width: 85px; width: 247px;
line-height: 17px; line-height: 17px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
......
<template> <template>
<div class="CloudDisk-R-Center row" v-if="dataList.length>0"> <div class="CloudDisk-R-Center row" v-if="dataList.length>0">
<el-table :data="dataList" style="width: 100%;" <el-table :data="dataList" style="width: 100%;"
ref="multipleTableRef"> ref="multipleTableRef"
<el-table-column type="selection" width="55" @selection-change="handleSelectionChange"
@selection-change="handleSelectionChange"/> row-key="DetailsId">
<el-table-column type="selection" width="55"/>
<el-table-column label="基本信息" show-overflow-tooltip min-width="200"> <el-table-column label="基本信息" show-overflow-tooltip min-width="200">
<template #default="scope"> <template #default="scope">
<div class="row items-center"> <div class="row items-center">
...@@ -49,9 +50,17 @@ ...@@ -49,9 +50,17 @@
</el-table-column> </el-table-column>
<el-table-column align="center" min-width="80"> <el-table-column align="center" min-width="80">
<template #header> <template #header>
<el-icon> <el-dropdown trigger="click" >
<IconSetting></IconSetting> <el-icon class="cursor-pointer" size="16" color="#b1b7cf"><IconSetting /></el-icon>
</el-icon> <template #dropdown>
<el-dropdown-menu class="q-pa-md microsoft">
<el-dropdown-item icon="CopyDocument" @click="CopyTo()">复制到</el-dropdown-item>
<el-dropdown-item icon="Expand" @click="MoveFile()">移动到</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="deleteImg()">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-dropdown trigger="click" > <el-dropdown trigger="click" >
...@@ -71,7 +80,8 @@ ...@@ -71,7 +80,8 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive } from "vue"; import { ref, reactive, watch } from "vue";
import { ElTable } from 'element-plus'
import CloudDiskService from "@/services/CloudDiskService"; import CloudDiskService from "@/services/CloudDiskService";
import { ApiResult } from "@/configs/axios"; import { ApiResult } from "@/configs/axios";
const props = defineProps({ const props = defineProps({
...@@ -82,6 +92,10 @@ ...@@ -82,6 +92,10 @@
Parent:{ Parent:{
type: Object, type: Object,
default: {}, default: {},
},
params:{
type: Object,
default: {},
} }
}) })
const emit = defineEmits<{ const emit = defineEmits<{
...@@ -97,10 +111,12 @@ ...@@ -97,10 +111,12 @@
const nickNam = ref(''|| Number) const nickNam = ref(''|| Number)
const editLoading = ref(false) const editLoading = ref(false)
const errImg = ref(require('@/assets/img/noImg.png') as any) const errImg = ref(require('@/assets/img/noImg.png') as any)
const multipleTableRef = ref<InstanceType<typeof ElTable>>()
const multipleSelection = ref([] as any) const multipleSelection = ref([] as any)
const handleSelectionChange = (val: []) =>{ const handleSelectionChange = (val: []) =>{
multipleSelection.value = val.map(x=>{return x.DetailsId}) multipleSelection.value = val.map(x=>{return x.DetailsId})
emit('MultipleChoice',multipleSelection.value)
} }
const setCloudNameHandler = async (target:any)=>{ const setCloudNameHandler = async (target:any)=>{
if(editLoading.value || nickNam.value=='' || !nickNam.value) return if(editLoading.value || nickNam.value=='' || !nickNam.value) return
...@@ -140,6 +156,49 @@ ...@@ -140,6 +156,49 @@
emit('deleteImg',item) emit('deleteImg',item)
} }
const toggleSelection = (rows:any,state:undefined) => {
if (rows) {
rows.forEach((row) => {
multipleTableRef.value!.toggleRowSelection(row, state)
})
} else {
if(state) multipleTableRef.value.toggleAllSelection(state)
else multipleTableRef.value!.clearSelection()
}
}
watch(()=>props,(n,o)=>{
if(props.Parent.SelectedDatas.length>0) {
setTimeout(()=>{
props.Parent.SelectedDatas.forEach(x => {
let filterS = props.dataList.filter((y,index)=>{
y.index=index
return x==y.DetailsId
})
let index = filterS&&filterS[0]&&filterS[0].index
if(index>=0) {
toggleSelection([props.dataList[index]],true)
}
});
},3000)
}
if(props.dataList.length>0&&props.Parent.selectAll&&!props.Parent.indeterminate){
setTimeout(()=>{
for(let i=0;i<props.dataList.length;i++){
let x = props.dataList[i]
toggleSelection([x], true)
}
},3000)
}
},{
deep: true,
immediate:true
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.editor-pencli{ .editor-pencli{
...@@ -149,7 +208,7 @@ ...@@ -149,7 +208,7 @@
display: block; display: block;
} }
.CloudDisk-R-Center::v-deep(.el-table__body){ .CloudDisk-R-Center::v-deep(.el-table__body){
margin-top: 8px; margin-top: 19px;
} }
.CloudDisk-R-Center::v-deep(.el-table__header-wrapper th){ .CloudDisk-R-Center::v-deep(.el-table__header-wrapper th){
background-color: #f5f7fa; background-color: #f5f7fa;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<div class="CloudDisk-R-Center"> <div class="CloudDisk-R-Center">
<Waterfall :list="dataList" <Waterfall :list="dataList"
:breakpoints="{ :breakpoints="{
1400:{rowPerView:12}, 1400:{rowPerView:5},
800:{rowPerView:12}, 800:{rowPerView:5},
500:{rowPerView:12} 500:{rowPerView:5}
}" }"
:hasAroundGutter="false" :align="'left'" :hasAroundGutter="false" :align="'left'"
rowKey="DetailsId" :gutter="24" rowKey="DetailsId" :gutter="24"
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
> >
<template #item="{ item, url, index }"> <template #item="{ item, url, index }">
<div style="position: relative;"> <div style="position: relative;">
<el-checkbox style="position: absolute;left: 30px;top: -3px;" <el-checkbox style="position: absolute;left: 10px;top: 0px;"
class="fz14" label="" v-model="item.check" class="fz14" label="" v-model="item.check"
@change="handleSelectionChange(item)"/> @change="handleSelectionChange(item)"/>
<el-dropdown trigger="click"> <el-dropdown trigger="click">
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive } from "vue"; import { ref, reactive, watch } from "vue";
import { LazyImg, Waterfall } from 'vue-waterfall-plugin-next' import { LazyImg, Waterfall } from 'vue-waterfall-plugin-next'
import 'vue-waterfall-plugin-next/dist/style.css' import 'vue-waterfall-plugin-next/dist/style.css'
import CloudDiskService from "@/services/CloudDiskService"; import CloudDiskService from "@/services/CloudDiskService";
...@@ -81,6 +81,10 @@ ...@@ -81,6 +81,10 @@
type: Array, type: Array,
default: [], default: [],
}, },
Parent:{
type: Object,
default: {},
}
}) })
const emit = defineEmits<{ const emit = defineEmits<{
(event: 'close'): void, (event: 'close'): void,
...@@ -105,7 +109,7 @@ ...@@ -105,7 +109,7 @@
if(filter.length==0&&row.check) { if(filter.length==0&&row.check) {
multipleSelection.value.push(row.DetailsId) multipleSelection.value.push(row.DetailsId)
emit('MultipleChoice',multipleSelection.value) emit('MultipleChoice',multipleSelection.value)
}else { }else if(!row.check){
let newFilter = props.Parent.SelectedDatas.filter(x=>x!=row.DetailsId) let newFilter = props.Parent.SelectedDatas.filter(x=>x!=row.DetailsId)
multipleSelection.value = newFilter multipleSelection.value = newFilter
emit('MultipleChoice',multipleSelection.value) emit('MultipleChoice',multipleSelection.value)
...@@ -147,6 +151,15 @@ ...@@ -147,6 +151,15 @@
emit('deleteImg',item) emit('deleteImg',item)
} }
watch(()=>props,(n,o)=>{
if(n.Parent.SelectedDatas.length==0) {
multipleSelection.value = []
}
},{
deep: true,
immediate:true
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.CloudDisk-R-Center{ .CloudDisk-R-Center{
...@@ -154,11 +167,11 @@ ...@@ -154,11 +167,11 @@
padding-left: 24px; padding-left: 24px;
} }
.CloudDisk-R-Box{ .CloudDisk-R-Box{
width: 87px; width: 247px;
position: relative; position: relative;
} }
.CloudDisk-R-Box.active .CloudDisk-R-Img{ .CloudDisk-R-Box.active .CloudDisk-R-Img{
width: 85px; width: 247px;
background: #8790F3; background: #8790F3;
box-shadow: 0px 0px 13px 0px #0D3EBC; box-shadow: 0px 0px 13px 0px #0D3EBC;
border-radius: 8px; border-radius: 8px;
...@@ -183,7 +196,8 @@ ...@@ -183,7 +196,8 @@
display: block; display: block;
} }
.CloudDisk-R-Img{ .CloudDisk-R-Img{
width: 85px; width: 247px;
min-height: 40px;
height: auto; height: auto;
margin-bottom: 9px; margin-bottom: 9px;
border-radius: 8px; border-radius: 8px;
...@@ -192,11 +206,11 @@ ...@@ -192,11 +206,11 @@
} }
.CloudDisk-R-Img .el-image{ .CloudDisk-R-Img .el-image{
width: 85px; width: 247px;
border-radius: 8px; border-radius: 8px;
} }
.title{ .title{
width: 85px; width: 247px;
line-height: 17px; line-height: 17px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
...@@ -221,6 +235,6 @@ ...@@ -221,6 +235,6 @@
} }
::v-deep(.lazy__img[lazy=error]){ ::v-deep(.lazy__img[lazy=error]){
padding: 0; padding: 0;
width: 85px !important; width: 247px !important;
} }
</style> </style>
\ No newline at end of file
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