|
@@ -22,9 +22,10 @@
|
|
|
<div class="searchFor">
|
|
|
<div class="search_title">分类:</div>
|
|
|
<el-tabs v-model="searchType" class="demo-tabs" @tab-change="changeSearchType">
|
|
|
+ <el-tab-pane label="全部" name="all"></el-tab-pane>
|
|
|
<el-tab-pane label="文档" name="doc"></el-tab-pane>
|
|
|
<el-tab-pane label="图片" name="img"></el-tab-pane>
|
|
|
- <el-tab-pane label="音频" name="audio "></el-tab-pane>
|
|
|
+ <el-tab-pane label="音频" name="audio"></el-tab-pane>
|
|
|
<el-tab-pane label="视频" name="video"></el-tab-pane>
|
|
|
<el-tab-pane label="压缩包" name="zip"></el-tab-pane>
|
|
|
</el-tabs>
|
|
@@ -43,7 +44,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 文件列表 -->
|
|
|
- <div class="fileList">
|
|
|
+ <div class="fileList" @scroll="mouseScroll">
|
|
|
<div>
|
|
|
<div v-if="isList">
|
|
|
<!-- 表格 -->
|
|
@@ -72,16 +73,17 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div class="pageBox">
|
|
|
+ <!-- <div class="pageBox">
|
|
|
<Pagination :total="total" :page="page" :limit="limit" @pagination="pagination"></Pagination>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<!-- 平铺 -->
|
|
|
<div class="tile_box">
|
|
|
<div class="file_box" v-for="item in tableData" :key="item">
|
|
|
<img class="big_file_img" :src="setIcon(item.fileType)" alt="" />
|
|
|
- <span>{{ item.fileName }}</span>
|
|
|
+ <span style="width: 90px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis">{{ item.fileName
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -91,7 +93,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, toRaw, inject ,watch} from "vue";
|
|
|
+import { onMounted, ref, toRaw, inject, watch } from "vue";
|
|
|
import { search } from "@/api/search/search.js";
|
|
|
import { flieSearch } from "@/api/search/search.js";
|
|
|
import { useRoute, useRouter, onBeforeRouteUpdate } from "vue-router";
|
|
@@ -126,8 +128,8 @@ const page = ref(1);
|
|
|
const limit = ref(2); //pagesize
|
|
|
//---------------------------
|
|
|
|
|
|
-const historyParams = history.state.params
|
|
|
-console.log('historyParams',historyParams);
|
|
|
+const historyParams = history.state.params
|
|
|
+console.log('historyParams', historyParams);
|
|
|
|
|
|
const reload = inject("reload");
|
|
|
onMounted(() => {
|
|
@@ -141,7 +143,7 @@ onMounted(() => {
|
|
|
// console.log("searchData", searchData);
|
|
|
baseData.value = searchData.rows;
|
|
|
tableData.value = searchData.rows;
|
|
|
- console.log(baseData.value,tableData.value,'value');
|
|
|
+ console.log(baseData.value, tableData.value, 'value');
|
|
|
total.value = searchData.total;
|
|
|
changeSearchFor(searchFor.value);
|
|
|
// console.log("total", baseData.value);
|
|
@@ -161,14 +163,17 @@ const changeSearchFor = (name) => {
|
|
|
// 切换搜索分类
|
|
|
const changeSearchType = (name) => {
|
|
|
let baseDataObj = toRaw(baseData.value);
|
|
|
- // console.log("baseDataObj", baseDataObj);
|
|
|
- // 获取分类具体数据
|
|
|
- const typeArr = setType(name);
|
|
|
- tableData.value = toRaw(baseDataObj).filter(
|
|
|
- (item) =>
|
|
|
- typeArr.includes(item.fileType) && item.space.spaceType == searchFor.value
|
|
|
- );
|
|
|
- // console.log('tableData',tableData.value);
|
|
|
+ if (name == 'all') {
|
|
|
+ tableData.value = baseDataObj
|
|
|
+ } else {
|
|
|
+ // 获取分类具体数据
|
|
|
+ console.log(name,'name');
|
|
|
+ const typeArr = setType(name);
|
|
|
+ console.log(typeArr,'类型');
|
|
|
+ tableData.value = toRaw(baseDataObj).filter((item) => {
|
|
|
+ return typeArr.includes(item.fileType) && item.space.spaceType === searchFor.value;
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
const changeShow = () => {
|
|
|
isList.value = !isList.value;
|
|
@@ -203,7 +208,7 @@ const handleCurrentChange = (val) => {
|
|
|
page.value = val;
|
|
|
};
|
|
|
const pagination = async (obj) => {
|
|
|
- console.log(obj,'page');
|
|
|
+ console.log(obj, 'page');
|
|
|
isAsc.value == "asc" ? (isAsc.value = "desc") : (isAsc.value = "asc");
|
|
|
const query = {
|
|
|
keyword: searchText.value,
|
|
@@ -260,7 +265,7 @@ const setIcon = (fileType) => {
|
|
|
const setType = (fileType) => {
|
|
|
switch (fileType) {
|
|
|
case "doc":
|
|
|
- return [".txt", ".ppt", ".pdf", ".docx", ".csv", ".wps", ".xls", '.pptxs','.dll'];
|
|
|
+ return [".txt", ".ppt", ".pdf", ".docx", ".csv", ".wps", ".xls", '.pptxs', '.dll', 'pptx', '.doc'];
|
|
|
break;
|
|
|
case "img":
|
|
|
return [".png", ".jpg", ".jpeg"];
|
|
@@ -294,6 +299,9 @@ function formatFileSize(fileSize) {
|
|
|
return fileSize + "B";
|
|
|
}
|
|
|
}
|
|
|
+function mouseScroll() {
|
|
|
+ console.log('鼠标滚动了!');
|
|
|
+}
|
|
|
onBeforeRouteUpdate((to, from) => {
|
|
|
console.log('to', to);
|
|
|
console.log('from', from);
|