|
@@ -47,65 +47,72 @@
|
|
|
</div>
|
|
|
<div v-if="isSearch" class="searchBtm">
|
|
|
<div class="highSearch">
|
|
|
- <div class="title">共查询到{{ props.hightDataTotal }}个相关结果</div>
|
|
|
- <div class="list">
|
|
|
- <div class="oneBox" v-for="item in hightData" :key="item.id" @click="toFile(item.content.docInfo)">
|
|
|
- <span class="fileName">{{ item.content.docInfo.fileName }}</span>
|
|
|
- <div class="flieTime">
|
|
|
- <span>创建时间:</span>
|
|
|
- <span>{{ item.content.docInfo.createTime }}</span>
|
|
|
- <div class="position">
|
|
|
- <span>文件位置:</span>
|
|
|
- <span>{{ item.content.docInfo.dir.dirPath }}</span>
|
|
|
+ <div v-loading="highLoading" v-if="highLoading" class="lodingBox"></div>
|
|
|
+ <div v-else>
|
|
|
+ <div class="title">共查询到{{ props.hightDataTotal }}个相关结果</div>
|
|
|
+ <div class="list">
|
|
|
+ <div
|
|
|
+ class="oneBox"
|
|
|
+ v-for="item in hightData"
|
|
|
+ :key="item.id"
|
|
|
+ @click="toFile(item.content.docInfo)"
|
|
|
+ >
|
|
|
+ <span class="fileName">{{ item.content.docInfo.fileName }}</span>
|
|
|
+ <div class="flieTime">
|
|
|
+ <span>创建时间:</span>
|
|
|
+ <span>{{ item.content.docInfo.createTime }}</span>
|
|
|
+ <div class="position">
|
|
|
+ <span>文件位置:</span>
|
|
|
+ <span>{{ item.content.docInfo.dir.dirPath }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ class="flieContent"
|
|
|
+ v-for="par in item.highlightFields.content"
|
|
|
+ :key="par"
|
|
|
+ v-html="par"
|
|
|
+ ></div>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="flieContent"
|
|
|
- v-for="par in item.highlightFields.content"
|
|
|
- :key="par"
|
|
|
- v-html="par"
|
|
|
- ></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="allSearch">
|
|
|
- <div class="title"><span>文件名匹配结果</span></div>
|
|
|
- <div class="num">共查询到{{ props.allDataTotal }}个相关结果</div>
|
|
|
- <el-table
|
|
|
- :data="allData"
|
|
|
- style="width: 100%"
|
|
|
- ref="container"
|
|
|
- height="584"
|
|
|
- scrollbar-always-on
|
|
|
- @row-click="toFile"
|
|
|
- >
|
|
|
- <el-table-column type="index" width="70" />
|
|
|
- <el-table-column label="名称" width="200">
|
|
|
- <template #default="scope">
|
|
|
- <div class="flie_name">
|
|
|
- <img
|
|
|
- class="table_icon"
|
|
|
- :src="setIcon(scope.row.fileType)"
|
|
|
- alt=""
|
|
|
- style=""
|
|
|
- />
|
|
|
- <span v-html="scope.row.fileName"></span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="dir.dirPath"
|
|
|
- label="所属空间"
|
|
|
- width="210"
|
|
|
- />
|
|
|
- <el-table-column prop="fileType" label="类型" width="100" />
|
|
|
- <el-table-column prop="createTime" label="时间" width="200" />
|
|
|
- <el-table-column prop="fileSize" label="大小" width="100">
|
|
|
- <template #default="scope">
|
|
|
- <div>{{ formatFileSize(scope.row.fileSize) }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <div v-loading="allLoading" v-if="allLoading" class="lodingBox"></div>
|
|
|
+ <div v-else>
|
|
|
+ <div class="title"><span>文件名匹配结果</span></div>
|
|
|
+ <div class="num">共查询到{{ props.allDataTotal }}个相关结果</div>
|
|
|
+ <el-table
|
|
|
+ :data="allData"
|
|
|
+ style="width: 100%"
|
|
|
+ ref="container"
|
|
|
+ height="584"
|
|
|
+ scrollbar-always-on
|
|
|
+ @row-click="toFile"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" width="70" />
|
|
|
+ <el-table-column label="名称" width="200">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="flie_name">
|
|
|
+ <img
|
|
|
+ class="table_icon"
|
|
|
+ :src="setIcon(scope.row.fileType)"
|
|
|
+ alt=""
|
|
|
+ style=""
|
|
|
+ />
|
|
|
+ <span v-html="scope.row.fileName"></span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="dir.dirPath" label="所属空间" width="210" />
|
|
|
+ <el-table-column prop="fileType" label="类型" width="100" />
|
|
|
+ <el-table-column prop="createTime" label="时间" width="200" />
|
|
|
+ <el-table-column prop="fileSize" label="大小" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>{{ formatFileSize(scope.row.fileSize) }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else class="btmBox">
|
|
@@ -260,7 +267,9 @@ const isSearch = ref(props.showSearch);
|
|
|
const searchText = ref(); // 搜索内容
|
|
|
const hightData = ref([]); // 高级搜索数据
|
|
|
const allData = ref([]); // 全域搜索数据
|
|
|
-const canSearch = ref(true)
|
|
|
+const canSearch = ref(true);
|
|
|
+const allLoading = ref(false);
|
|
|
+const highLoading= ref(false);
|
|
|
|
|
|
const emit = defineEmits(["openMaxmin", "changeSearch"]);
|
|
|
const props = defineProps({
|
|
@@ -284,18 +293,26 @@ const props = defineProps({
|
|
|
type: Number,
|
|
|
default: 0,
|
|
|
},
|
|
|
+ highSearching: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ allSearching: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
});
|
|
|
//搜索事件
|
|
|
const searchBtn = () => {
|
|
|
// console.log("searchText", searchText.value);
|
|
|
- if(!canSearch.value){
|
|
|
- return
|
|
|
- }else{
|
|
|
- canSearch.value = false
|
|
|
- setTimeout(() => {
|
|
|
- canSearch.value = true
|
|
|
- }, 3000);
|
|
|
- }
|
|
|
+ if (!canSearch.value) {
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ canSearch.value = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ canSearch.value = true;
|
|
|
+ }, 3000);
|
|
|
+ }
|
|
|
if (!searchText.value) {
|
|
|
ElMessage({
|
|
|
message: "请输入关键字",
|
|
@@ -303,21 +320,19 @@ const searchBtn = () => {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
-bus.emit('test',1,1)
|
|
|
emit("changeSearch", true, searchText.value);
|
|
|
};
|
|
|
// 获取数据
|
|
|
const getList = async () => {
|
|
|
const resN = await listRecent({ isFolder: "N" });
|
|
|
- console.log('resN',resN);
|
|
|
if (resN.code === 200) {
|
|
|
tableFileData.value.length = resN.rows.length;
|
|
|
for (let index = 0; index < resN.rows.length; index++) {
|
|
|
- getInfo(resN.rows[index].relaId).then(async(res) => {
|
|
|
+ getInfo(resN.rows[index].relaId).then(async (res) => {
|
|
|
// tableFileData.value.push(res.data);
|
|
|
- tableFileData.value.splice(index,1,res.data);
|
|
|
- index++
|
|
|
- })
|
|
|
+ tableFileData.value.splice(index, 1, res.data);
|
|
|
+ index++;
|
|
|
+ });
|
|
|
}
|
|
|
// console.log('tableFileData',tableFileData.value);
|
|
|
// 将tableFileData里的数据按照createTime排序
|
|
@@ -490,10 +505,13 @@ const closeOpenScanMove = () => {
|
|
|
//粘贴文件上传
|
|
|
const copyFile = (event) => {
|
|
|
const items = (event.clipboardData || window.clipboardData).items;
|
|
|
- console.log('event',event);
|
|
|
+ console.log("event", event);
|
|
|
let file = null;
|
|
|
if (!items || items.length === 0) {
|
|
|
- ElMessage({ message: "请选当前浏览器不支持本地或请打开图片再复制择文件", type: "error" })
|
|
|
+ ElMessage({
|
|
|
+ message: "请选当前浏览器不支持本地或请打开图片再复制择文件",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
return;
|
|
|
}
|
|
|
// // 搜索剪切板items
|
|
@@ -548,6 +566,26 @@ watch(
|
|
|
deep: true,
|
|
|
}
|
|
|
);
|
|
|
+watch(
|
|
|
+ () => props.highSearching,
|
|
|
+ (newValue, oldValue) => {
|
|
|
+ highLoading.value = newValue;
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ }
|
|
|
+);
|
|
|
+watch(
|
|
|
+ () => props.allSearching,
|
|
|
+ (newValue, oldValue) => {
|
|
|
+ allLoading.value = newValue;
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ }
|
|
|
+);
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
getSpaceList();
|
|
@@ -917,6 +955,12 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.lodingBox {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ z-index: 10000000;
|
|
|
+}
|
|
|
.checkScan {
|
|
|
background-color: #f5f7f9;
|
|
|
}
|
|
@@ -936,9 +980,9 @@ onMounted(() => {
|
|
|
:deep(em) {
|
|
|
background: #fff0ba !important;
|
|
|
}
|
|
|
-.hoverColor{
|
|
|
- &:hover{
|
|
|
- background-color: #236EC3;
|
|
|
+.hoverColor {
|
|
|
+ &:hover {
|
|
|
+ background-color: #236ec3;
|
|
|
}
|
|
|
}
|
|
|
</style>
|