Commit d4ca7880 authored by zhengke's avatar zhengke

列表 组件

parent e12aaccf
......@@ -53,50 +53,13 @@
style="height: 100%; overflow: auto"
>
<el-scrollbar @scroll="scrollingHandler" class="q-px-md" style="height: 100%;">
<div style="min-width: '700px';height: 100%;">
<table class="text-small" style="width: 100%">
<tr @click="OffEdit">
<th class="text-left"
:style="{'width':currentMenu==3||currentMenu==4?'20px':'0px'}">
<el-checkbox v-if="currentMenu==3||currentMenu==4"
size="sm"
class="SelectAllBox"
v-model="datas.selectAll"
@click="clickSelectAll"
:indeterminate="isIndeterminate"
/>
</th>
<th colspan="2" class="text-light">
<div class="text-left q-pl-md">文档名称</div>
</th>
<th class="text-light" style="min-width: 150px; width: 150px">
<div class="row items-center just-center pointer" @click.stop="clickSort">
<span>最近修浏览 </span>
<span class="column">
<el-icon class="reactive"
style="top: 3px" :class="[queryObj.OrderByType==1?'active':'']"><CaretTop /></el-icon>
<el-icon class="reactive"
style="top:-3px" :class="[queryObj.OrderByType==2?'active':'']"><CaretBottom /></el-icon>
</span>
</div>
</th>
<th class="text-light" style="min-width: 100px; width: 100px">
创建者
</th>
<th class="text-light" style="min-width: 120px; width: 120px">
操作
</th>
</tr>
<journeyAdsList
<journeyAdsList
:current-menu="currentMenu"
:list="dataList"
:msg="queryObj"
:selected-datas="datas.selectedDatas"
@UpdateData="UpdateData"
@success="success"
@refreshHandler="cribrosin"></journeyAdsList>
</table>
</div>
@refreshHandler="refreshHandler"></journeyAdsList>
<div
v-if="dataList.length == 0 && !loading"
class="q-mt-lg bg-white rounded"
......@@ -123,13 +86,6 @@
></div>
</el-scrollbar>
</div>
<TreeFile v-if="isTreeFile"
:selected-datas="datas.selectedDatas"
:set-file-list="datas.setFileList"
:file-type="queryObj.FileType"
@close="() => isTreeFile=false"
@success="success"></TreeFile>
</template>
<script setup lang="ts">
......@@ -156,7 +112,6 @@
});
const PopoverVisibleControls = ref(false);
const isTreeFile = ref(false)
const Navigations = ref([] as Array<any>);
const isIndeterminate = ref(false);
const dataList = ref([] as Array<any>);
......@@ -185,28 +140,12 @@
const UpdateData = (obj:any) =>{
dataList.value = obj.list
singleChoice(obj.row)
}
const success = () => {
isTreeFile.value =false;
datas.selectAll = false;
datas.selectedDatas = [];
refreshHandler()
}
const cribrosin = (msg:any) =>{
if(msg&&msg.FileId!=undefined){
datas.selectAll = false
datas.selectedDatas = []
isIndeterminate.value = false
}
if(msg) queryObj = msg
refreshHandler()
}
const clickSort = () =>{
if(queryObj.OrderByType==2) queryObj.OrderByType = 1
else queryObj.OrderByType = 2
refreshHandler()
}
const sellAdd = (type:number) =>{
searchData.value.sellId = 0
......@@ -246,49 +185,7 @@
}
}
};
// 全选按钮
const clickSelectAll = () => {
setTimeout(() => {
for (let i = 0; i < dataList.value.length; i++) {
if (datas.selectAll == true) {
datas.selectedDatas.push(dataList.value[i].FileId)
dataList.value[i].singleChoice = true;
}
else {
datas.selectedDatas = [];
isIndeterminate.value = false;
dataList.value[i].singleChoice = false;
}
}
}, 100);
};
const singleChoice = (row: any) => {
isIndeterminate.value = false;
if (!row.singleChoice) {
datas.selectedDatas.push(row.FileId);
} else {
let index;
for (let i = 0; i < datas.selectedDatas.length; i++) {
if (datas.selectedDatas[i] == row.FileId) index = i;
}
datas.selectedDatas.splice(index, 1);
isIndeterminate.value = true;
}
let checkedCount = datas.selectedDatas.length;
let datasList = dataList.value.length;
if (datasList > 0 && checkedCount > 0 && datasList == checkedCount)
datas.selectAll = true;
if (datasList > 0 && checkedCount > 0 && datasList > checkedCount) {
datas.selectAll = "";
isIndeterminate.value = true;
}
if (checkedCount == 0) {
datas.selectAll = ""
isIndeterminate.value = false;
}
};
const querySearchHandler = async () => {
loading.value = true;
try {
......@@ -301,14 +198,6 @@
x.singleChoice = false;
x.Id = ''
x.showSelect = false
if (datas.selectAll) {
x.singleChoice = true;
datas.selectedDatas.push(x.FileId);
} else if (
datas.selectedDatas.length > 0 &&
datas.selectedDatas.indexOf(x.FileId) != -1
)
x.singleChoice = true;
const date1 = new Date();
const date2 = new Date(x.UpdateTime);
x.Day = getDaysBetween(date1, date2);
......@@ -340,7 +229,13 @@
}
}
};
const refreshHandler = () => {
const refreshHandler = (obj:any) => {
if(obj){
if(obj.FileId) {
queryObj.FileId = obj.FileId
}
if(obj.OrderByType) queryObj.OrderByType = obj.OrderByType
}
datas.RefreshLoading = true;
queryObj.pageIndex = 1;
querySearchHandler();
......
......@@ -63,7 +63,6 @@
:props="defaultProps"
v-model="datas.FolderId"
:data="dataList"
default-expand-all
check-strictly
:render-after-expand="false"
style="width: 220px"
......
......@@ -112,6 +112,7 @@ import CopyFile from "./CopyFile.vue";
})
const emit = defineEmits<{
(event: 'close'): void
(event: 'refreshHandler'): void
}>()
const datas = reactive({
type: 1,
......@@ -186,6 +187,7 @@ import CopyFile from "./CopyFile.vue";
const refreshHandler = () => {
queryObj.pageIndex = 1;
querySearchHandler();
emit('refreshHandler')
};
querySearchHandler()
......
......@@ -56,7 +56,6 @@
:props="defaultProps"
v-model="datas.FolderId"
:data="dataList"
default-expand-all
check-strictly
:render-after-expand="false"
style="width: 220px"
......@@ -98,6 +97,10 @@ import FolderService from "@/services/FolderService";
fileType: {
type:Number,
required: 1
},
fileId:{
type: Number,
required: ''
}
})
const emit = defineEmits<{
......@@ -123,7 +126,7 @@ import FolderService from "@/services/FolderService";
FolderObj: {},
checkedKeys: null as any
})
datas.FolderId = props.details?props.details.ParentFileId:props.setFileList[0].ParentFileId
datas.FolderId = props.fileId
const show=ref(true)
const loading = ref(true)
const deleteLoading = ref<any>(null);
......
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