|
@@ -36,9 +36,10 @@
|
|
|
type="text"
|
|
|
class="search_input"
|
|
|
v-model="searchText"
|
|
|
+ @keyup.enter="searchBtn"
|
|
|
placeholder="请输入关键字"
|
|
|
/>
|
|
|
- <div class="searchBtn" @click="searchBtn" @keyup.enter="searchBtn">
|
|
|
+ <div class="searchBtn" @click="searchBtn">
|
|
|
<img src="@/assets/images/newIndex/search.png" alt="" />
|
|
|
<span>全域瞬搜</span>
|
|
|
</div>
|
|
@@ -259,6 +260,7 @@ const isSearch = ref(props.showSearch);
|
|
|
const searchText = ref(); // 搜索内容
|
|
|
const hightData = ref([]); // 高级搜索数据
|
|
|
const allData = ref([]); // 全域搜索数据
|
|
|
+const canSearch = ref(true)
|
|
|
|
|
|
const emit = defineEmits(["openMaxmin", "changeSearch"]);
|
|
|
const props = defineProps({
|
|
@@ -286,6 +288,14 @@ const props = defineProps({
|
|
|
//搜索事件
|
|
|
const searchBtn = () => {
|
|
|
// console.log("searchText", searchText.value);
|
|
|
+ if(!canSearch.value){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ canSearch.value = false
|
|
|
+ setTimeout(() => {
|
|
|
+ canSearch.value = true
|
|
|
+ }, 3000);
|
|
|
+ }
|
|
|
if (!searchText.value) {
|
|
|
ElMessage({
|
|
|
message: "请输入关键字",
|
|
@@ -299,12 +309,25 @@ bus.emit('test',1,1)
|
|
|
// 获取数据
|
|
|
const getList = async () => {
|
|
|
const resN = await listRecent({ isFolder: "N" });
|
|
|
+ console.log('resN',resN);
|
|
|
if (resN.code === 200) {
|
|
|
- var arr = [];
|
|
|
- resN.rows.map(async (item) => {
|
|
|
- const detail = await getInfo(item.relaId);
|
|
|
- tableFileData.value.push(detail.data);
|
|
|
- });
|
|
|
+ tableFileData.value.length = resN.rows.length;
|
|
|
+ for (let index = 0; index < resN.rows.length; index++) {
|
|
|
+ getInfo(resN.rows[index].relaId).then(async(res) => {
|
|
|
+ // tableFileData.value.push(res.data);
|
|
|
+ tableFileData.value.splice(index,1,res.data);
|
|
|
+ index++
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // console.log('tableFileData',tableFileData.value);
|
|
|
+ // 将tableFileData里的数据按照createTime排序
|
|
|
+ // tableFileData.value = tableFileData.value.sort((a, b) => {
|
|
|
+ // return new Date(b.createTime) - new Date(a.createTime);
|
|
|
+ // });
|
|
|
+ // resN.rows.map(async (item) => {
|
|
|
+ // const detail = await getInfo(item.relaId);
|
|
|
+ // tableFileData.value.push(detail.data);
|
|
|
+ // });
|
|
|
}
|
|
|
};
|
|
|
// 打开最近文件
|