|
@@ -78,7 +78,6 @@
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
style="width: 100%"
|
|
|
- height="100%"
|
|
|
:scrollbar-always-on="true"
|
|
|
>
|
|
|
<el-table-column fixed prop="fileName" label="名称" width="500">
|
|
@@ -94,7 +93,11 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="space.spaceName" label="所属空间" width="180" />
|
|
|
+ <el-table-column
|
|
|
+ prop="space.spaceName"
|
|
|
+ label="所属空间"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
<el-table-column prop="createTime" label="时间" width="200" />
|
|
|
<el-table-column prop="fileType" label="类型" width="80" />
|
|
|
<el-table-column prop="fileSize" label="大小" width="160">
|
|
@@ -105,11 +108,17 @@
|
|
|
<el-table-column prop="dir.dirPath" label="文件夹" width="180">
|
|
|
<template #default="scope">
|
|
|
<div class="folder">
|
|
|
- {{ scope.row.dir?scope.row.dir.dirPath:'' }}
|
|
|
+ {{ scope.row.dir ? scope.row.dir.dirPath : "" }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <Pagination
|
|
|
+ :total="total"
|
|
|
+ :page="page"
|
|
|
+ :limit="limit"
|
|
|
+ @pagination="pagination"
|
|
|
+ ></Pagination>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<!-- 平铺 -->
|
|
@@ -129,19 +138,25 @@
|
|
|
import { onMounted, ref, toRaw, inject } from "vue";
|
|
|
import { search } from "@/api/search/search.js";
|
|
|
import { flieSearch } from "@/api/search/search.js";
|
|
|
-import { useRoute,useRouter } from "vue-router";
|
|
|
+import { useRoute, useRouter } from "vue-router";
|
|
|
+import Pagination from "@/components/Pagination/index.vue";
|
|
|
const searchFor = ref("1"); //搜索范围
|
|
|
const searchType = ref("doc"); //搜索对象
|
|
|
const checkState = ref(false); //勾选框状态
|
|
|
const activeNames = ref(["folder", "file"]);
|
|
|
const isList = ref(true); //控制显示方式
|
|
|
const isContent = ref(false); //内容搜索
|
|
|
-const total = ref(0); //数据总条数
|
|
|
+// const total = ref(0); //数据总条数
|
|
|
const searchText = ref(""); //搜索ipt的值
|
|
|
const baseData = ref(); //搜索出的原始数据
|
|
|
const isAsc = ref("asc");
|
|
|
const router = useRouter(); //注册路由
|
|
|
|
|
|
+//---------分页--------------
|
|
|
+const total = ref(0);
|
|
|
+const page = ref(1);
|
|
|
+const limit = ref(2); //pagesize
|
|
|
+//---------------------------
|
|
|
|
|
|
const reload = inject("reload");
|
|
|
onMounted(() => {
|
|
@@ -200,9 +215,31 @@ const fliterListData = (dataList) => {
|
|
|
return dataList;
|
|
|
};
|
|
|
// 回退
|
|
|
-const goBack = ()=>{
|
|
|
- router.back()
|
|
|
-}
|
|
|
+const goBack = () => {
|
|
|
+ router.back();
|
|
|
+};
|
|
|
+
|
|
|
+//分页
|
|
|
+const handleSizeChange = (val) => {
|
|
|
+ limit.value = val;
|
|
|
+};
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
+ page.value = val;
|
|
|
+};
|
|
|
+const pagination = async (obj) => {
|
|
|
+ isAsc.value == "asc" ? (isAsc.value = "desc") : (isAsc.value = "asc");
|
|
|
+ const query = {
|
|
|
+ keyword: searchText.value,
|
|
|
+ isAsc: isAsc.value,
|
|
|
+ page: obj.page,
|
|
|
+ size: obj.limit,
|
|
|
+ orderByColumn: "createTime",
|
|
|
+ };
|
|
|
+ const res = await flieSearch(query);
|
|
|
+ baseData.value = res.rows;
|
|
|
+ tableData.value = res.rows;
|
|
|
+ changeSearchFor(searchFor.value);
|
|
|
+};
|
|
|
// 设置图标
|
|
|
const setIcon = (fileType) => {
|
|
|
switch (fileType) {
|
|
@@ -246,7 +283,7 @@ const setIcon = (fileType) => {
|
|
|
const setType = (fileType) => {
|
|
|
switch (fileType) {
|
|
|
case "doc":
|
|
|
- return ['.txt',".ppd", ".pdf", ".docx", ".csv",".wps",'.xls'];
|
|
|
+ return [".txt", ".ppd", ".pdf", ".docx", ".csv", ".wps", ".xls"];
|
|
|
break;
|
|
|
case "img":
|
|
|
return [".png", ".jpg", ".jpeg"];
|
|
@@ -258,10 +295,10 @@ const setType = (fileType) => {
|
|
|
return [".mp4"];
|
|
|
break;
|
|
|
case "zip":
|
|
|
- return [".zip",'rar','.7z'];
|
|
|
+ return [".zip", "rar", ".7z"];
|
|
|
break;
|
|
|
default:
|
|
|
- return [''];
|
|
|
+ return [""];
|
|
|
break;
|
|
|
}
|
|
|
};
|