From fe1bfc28d8cae713be47b552cce4e6d9d7d23d24 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 5 Jul 2024 16:08:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E7=9B=B8=E5=85=B3=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 82 ++++++++++++------------------------ src/assets/images/menu.svg | 1 + src/assets/images/more.svg | 1 + src/assets/images/more1.svg | 1 + src/layouts/header/index.vue | 53 +++++++---------------- src/store/index.js | 51 +++++++++++----------- 6 files changed, 71 insertions(+), 118 deletions(-) create mode 100644 src/assets/images/menu.svg create mode 100644 src/assets/images/more.svg create mode 100644 src/assets/images/more1.svg diff --git a/src/App.vue b/src/App.vue index 8b201f1..9fb7de9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,8 +5,8 @@ diff --git a/src/assets/images/menu.svg b/src/assets/images/menu.svg new file mode 100644 index 0000000..32f198f --- /dev/null +++ b/src/assets/images/menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/more.svg b/src/assets/images/more.svg new file mode 100644 index 0000000..dde164d --- /dev/null +++ b/src/assets/images/more.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/more1.svg b/src/assets/images/more1.svg new file mode 100644 index 0000000..578129c --- /dev/null +++ b/src/assets/images/more1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 7383053..1d86f58 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -30,8 +30,21 @@
- - + +
+ + +
    +
  • + +

    {{ item.buttonText }}

    +
  • +
+ +
+
+ +
@@ -159,29 +172,6 @@ export default { } } }, - // 切换显示搜索 - toggleSearch () { - this.showSearch = !this.showSearch - this.$nextTick(() => { - this.$refs.search.focus() - }) - }, - // mail点击 - toMail () { - window.open('https://qiye.aliyun.com/alimail/auth/login?custom_login_flag=1&reurl=%2Falimail%2F') - }, - // oa点击 - toOa () { - window.open('http://oa.iasf.ac.cn/sys/portal/page.jsp') - }, - // 切换语言 - toggleLang () { - let id = +(this.$route.query.siteId || this.$store.state.content.site) - // 中英文站点的id是相邻的,有6个站点,1/2 3/4 5/6 - id % 2 ? id++ : id-- - location.href = this.$router.resolve(`/column?siteId=${id}`).href - location.reload() - }, // 图标点击 toolClick (item) { // 链接 @@ -205,19 +195,6 @@ export default { } } }, - // 全局搜索 - handleSearch () { - this.setKeyword(this.title) - this.modelType = !this.modelType - if (this.title) { - this.showSearch = false - this.$router.push(`/column/result`) - } - }, - // 更改右侧盒子样式 - updateModelType () { - this.modelType = !this.modelType - }, updateType (type) { this.modelType = type } diff --git a/src/store/index.js b/src/store/index.js index 745a7bc..497356f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,35 +10,36 @@ const modulesFiles = require.context('./modules', true, /\.js$/); // you do not need `import app from './modules/app'` // it will auto require all vuex module from modules file const modules = modulesFiles.keys().reduce((modules, modulePath) => { - // set './app.js' => 'app' - const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1'); - const value = modulesFiles(modulePath); - modules[moduleName] = value.default; - return modules; + // set './app.js' => 'app' + const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1'); + const value = modulesFiles(modulePath); + modules[moduleName] = value.default; + return modules; }, {}); const store = new Vuex.Store({ - state: { - modelType: false, //true为PC端,false为手机端 - navSum: sessionStorage.getItem('navPageSize') || 10, // 导航栏显示的条目数量 + state: { + modelType: false, //true为PC端,false为手机端 + navSum: sessionStorage.getItem('navPageSize') || 10, // 导航栏显示的条目数量 + }, + mutations: { + // 根据屏幕尺寸分别移动或者pc + updateModelType (state, type) { + console.log("🚀 ~ updateModelType ~ type:", type) + state.modelType = type; }, - mutations: { - // 根据屏幕尺寸分别移动或者pc - updateModelType(state, type) { - state.modelType = type; - }, - // 根据屏幕尺寸显示的导航栏条数 - updateNavSum(state,num) { - state.navSum = num - } - }, - actions: { - updateNavSumA({ commit },data) { - commit('updateNavSum',data) - } - }, - modules, - getters + // 根据屏幕尺寸显示的导航栏条数 + updateNavSum (state, num) { + state.navSum = num + } + }, + actions: { + updateNavSumA ({ commit }, data) { + commit('updateNavSum', data) + } + }, + modules, + getters }); export default store;