|
|
@@ -13,8 +13,8 @@
|
|
|
size="small"
|
|
|
placeholder="搜索文件"
|
|
|
suffix-icon="Search"
|
|
|
+ clearable
|
|
|
@change="toSearch"
|
|
|
-
|
|
|
/>
|
|
|
</div>
|
|
|
<div>
|
|
|
@@ -24,9 +24,10 @@
|
|
|
trigger="click"
|
|
|
>
|
|
|
<div class="avatar-wrapper">
|
|
|
- <img src="@/assets/images/profile.jpg" class="head-img" /><span
|
|
|
- >{{ logingName }}</span
|
|
|
- >
|
|
|
+ <img
|
|
|
+ src="@/assets/images/profile.jpg"
|
|
|
+ class="head-img"
|
|
|
+ /><span>{{ logingName }}</span>
|
|
|
</div>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
@@ -48,7 +49,10 @@
|
|
|
:key="index"
|
|
|
@click="clickPath(index)"
|
|
|
><div
|
|
|
- :class="$route.path==item.path ? 'acitve-img-style img-style' : 'img-style'
|
|
|
+ :class="
|
|
|
+ $route.path == item.path
|
|
|
+ ? 'acitve-img-style img-style'
|
|
|
+ : 'img-style'
|
|
|
"
|
|
|
>
|
|
|
<img :src="clickId == index ? item.beimgs : item.imgs" />
|
|
|
@@ -68,11 +72,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref } from 'vue'
|
|
|
-import { ElMessageBox } from 'element-plus'
|
|
|
-import useAppStore from '@/store/modules/app'
|
|
|
-import useUserStore from '@/store/modules/user'
|
|
|
-import useSettingsStore from '@/store/modules/settings'
|
|
|
+import { onMounted, ref } from "vue";
|
|
|
+import { ElMessageBox } from "element-plus";
|
|
|
+import useAppStore from "@/store/modules/app";
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
+import useSettingsStore from "@/store/modules/settings";
|
|
|
import Cookies from "js-cookie";
|
|
|
import chat from "@/assets/images/chat.png";
|
|
|
import bechat from "@/assets/images/bechat.png";
|
|
|
@@ -89,21 +93,24 @@ import becommon from "@/assets/images/becommon.png";
|
|
|
import chuanshu from "@/assets/images/chuanshu.png";
|
|
|
import bechuanshu from "@/assets/images/bechuanshu.png";
|
|
|
import { AppMain, Navbar, Settings, TagsView } from "./components";
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
+import { search } from "@/api/search/search.js";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
const router = useRouter(); //注册路由
|
|
|
-const appStore = useAppStore()
|
|
|
-const userStore = useUserStore()
|
|
|
-const settingsStore = useSettingsStore()
|
|
|
-const searchText = ref('') //搜索ipt的值
|
|
|
+const appStore = useAppStore();
|
|
|
+const userStore = useUserStore();
|
|
|
+const settingsStore = useSettingsStore();
|
|
|
+const searchText = ref(""); //搜索ipt的值
|
|
|
+const selectValue = ref(1); //文档空间类型
|
|
|
+
|
|
|
|
|
|
function toggleSideBar() {
|
|
|
- appStore.toggleSideBar()
|
|
|
+ appStore.toggleSideBar();
|
|
|
}
|
|
|
-const logingName=ref('')
|
|
|
+const logingName = ref("");
|
|
|
onMounted(() => {
|
|
|
- logingName.value=Cookies.get('username')
|
|
|
+ logingName.value = Cookies.get("username");
|
|
|
// console.log('router',router)
|
|
|
-})
|
|
|
+});
|
|
|
function handleCommand(command) {
|
|
|
switch (command) {
|
|
|
case "setLayout":
|
|
|
@@ -118,28 +125,42 @@ function handleCommand(command) {
|
|
|
}
|
|
|
|
|
|
function logout() {
|
|
|
- ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- userStore.logOut().then(() => {
|
|
|
- location.href = '/index';
|
|
|
+ ElMessageBox.confirm("确定注销并退出系统吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ userStore.logOut().then(() => {
|
|
|
+ location.href = "/index";
|
|
|
+ });
|
|
|
})
|
|
|
- }).catch(() => { });
|
|
|
+ .catch(() => {});
|
|
|
}
|
|
|
|
|
|
// 跳转到全文搜索
|
|
|
-const toSearch = ()=>{
|
|
|
+const toSearch = async () => {
|
|
|
// console.log('searchText = ',searchText.value);
|
|
|
- router.push('/search');
|
|
|
-
|
|
|
-}
|
|
|
-const emits = defineEmits(['setLayout'])
|
|
|
+ const query = {
|
|
|
+ keyword: searchText.value,
|
|
|
+ page: 1,
|
|
|
+ size: 10,
|
|
|
+ type: selectValue.value,
|
|
|
+ };
|
|
|
+ const res = await search(query);
|
|
|
+ console.log("res", res);
|
|
|
+ if (res) {
|
|
|
+ router.push({
|
|
|
+ path: "/search",
|
|
|
+ query: { searchData: JSON.stringify(res) },
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+const emits = defineEmits(["setLayout"]);
|
|
|
function setLayout() {
|
|
|
- emits('setLayout');
|
|
|
+ emits("setLayout");
|
|
|
}
|
|
|
-const clickId = ref('');
|
|
|
+const clickId = ref("");
|
|
|
const menuList = reactive({
|
|
|
data: [
|
|
|
{
|
|
|
@@ -184,6 +205,12 @@ const menuList = reactive({
|
|
|
imgs: common,
|
|
|
beimgs: becommon,
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "高级搜索",
|
|
|
+ path: "/highsearch",
|
|
|
+ imgs: common,
|
|
|
+ beimgs: becommon,
|
|
|
+ },
|
|
|
{
|
|
|
label: "传输列表",
|
|
|
path: "/ws",
|
|
|
@@ -206,8 +233,8 @@ const clickPath = (index) => {
|
|
|
.el-container {
|
|
|
height: 100vh;
|
|
|
}
|
|
|
-:deep .el-main{
|
|
|
- --el-main-padding:8px !important;
|
|
|
+:deep .el-main {
|
|
|
+ --el-main-padding: 8px !important;
|
|
|
}
|
|
|
.nav {
|
|
|
background: #06286c;
|
|
|
@@ -216,8 +243,8 @@ const clickPath = (index) => {
|
|
|
width: 98%;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- &>div:first-child{
|
|
|
- font-family:"Inter-SemiBold";
|
|
|
+ & > div:first-child {
|
|
|
+ font-family: "Inter-SemiBold";
|
|
|
}
|
|
|
& > div:first-child,
|
|
|
& > div:last-child {
|
|
|
@@ -234,7 +261,7 @@ const clickPath = (index) => {
|
|
|
border-radius: 12px;
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
- margin-right:10px;
|
|
|
+ margin-right: 10px;
|
|
|
}
|
|
|
.avatar-wrapper {
|
|
|
color: #fff;
|
|
|
@@ -249,7 +276,10 @@ const clickPath = (index) => {
|
|
|
border-radius: 4px;
|
|
|
margin-top: 8px;
|
|
|
background: #6f85b5 !important;
|
|
|
- --el-input-border-color:#6F85B5
|
|
|
+ --el-input-border-color: #6f85b5;
|
|
|
+ }
|
|
|
+ ::v-deep .el-input__inner {
|
|
|
+ color: #fff !important;
|
|
|
}
|
|
|
}
|
|
|
:deep .el-input__wrapper {
|
|
|
@@ -288,4 +318,32 @@ const clickPath = (index) => {
|
|
|
text-align: center;
|
|
|
color: #000;
|
|
|
}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.el-popper.is-light.type_popper {
|
|
|
+ background-color: #1f3f7e !important;
|
|
|
+ border-radius: 4px 4px 4px 4px !important;
|
|
|
+ border: none !important;
|
|
|
+ // padding: 0 16px !important;
|
|
|
+ // box-sizing: border-box !important;
|
|
|
+}
|
|
|
+.el-popper__arrow::before{
|
|
|
+ content: none;
|
|
|
+}
|
|
|
+ //鼠标移动上去的选中色
|
|
|
+.type_popper {
|
|
|
+ .el-select-dropdown__item.hover,
|
|
|
+ .el-select-dropdown__item:hover {
|
|
|
+ background: #6F85B5 !important;
|
|
|
+ }
|
|
|
+ //下拉框的文本颜色
|
|
|
+ .el-select-dropdown__item {
|
|
|
+ color: #A4B0D8 !important;
|
|
|
+ }
|
|
|
+ //选中之后的颜色
|
|
|
+ .el-select-dropdown__item.selected {
|
|
|
+ background: #6F85B5 !important;
|
|
|
+ color: #fff !important;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|