From 962b50c58587213e758b127a52bc38c917592dc6 Mon Sep 17 00:00:00 2001 From: litian <2804272236@qq.com> Date: 星期二, 21 五月 2024 11:20:56 +0800 Subject: [PATCH] config --- src/views/home.vue | 251 ++++++++++++++++++++++++++++---------------------- 1 files changed, 140 insertions(+), 111 deletions(-) diff --git a/src/views/home.vue b/src/views/home.vue index b4ac3ad..432a76b 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -13,15 +13,16 @@ <!-- 鑿滃崟 --> <div class="menuBox"> <div - :class="['menuItem', activeMenu == item.name ? 'active' : '']" v-for="(item, index) in menuData" :key="index" @click="menuItemClick(item.name)" > + <div :class="['menuItem', activeMenu == item.name ? 'active' : '']" v-if="item.isShow"> <div class="menuIcon imgBox"> <img :src="item.icon" /> </div> <div class="name">{{ item.name }}</div> + </div> </div> <!-- <div class="reload hover" @click="reload()">鍒锋柊</div> --> <!-- 璁剧疆 --> @@ -379,15 +380,11 @@ </div> <div class="menuList"> <ul class="menu"> - <li - v-for="item in teachToolsMenuData" - :key="item.key" - :class="item.name === activeTool ? 'activeItem hover' : 'menuItem hover'" - :style="!toolState.open ? 'padding:10px 15px' : ''" - @click="selectTeachTools(item)" - > + <li v-for="item in teachToolsMenuData" :key="item.key"> + <div :class="item.name === activeTool ? 'activeItem hover' : 'menuItem hover'" :style="!toolState.open ? 'padding:10px 15px' : ''" v-if="item.isShow" @click="selectTeachTools(item)"> <img :src="item.icon" alt="" /> <span v-if="toolState.open">{{ item.name }}</span> + </div> </li> </ul> </div> @@ -444,6 +441,7 @@ @mouseover="floatOverHander(item)" @mouseout="floatOutHander(item)" > + <div v-if="item.isShow"> <el-popover placement="right" width="120" @@ -492,6 +490,7 @@ /> <div class="text">{{ item.name }}</div> </div> + </div> </div> </div> <div @@ -1065,8 +1064,137 @@ } } ) + +let menuData = [] //鑿滃崟 +let teachToolsMenuData = [] //鍙充晶瀛︿範缁勪欢 +let floatingToolBox = [] //涓棿鎮诞缁勪欢 //鑾峰彇褰撳墠涔︾睄鎵�闇�缁勪欢 -const getTextbookComponents = () => {} +const getTextbookComponents = () => { + menuData = [] + teachToolsMenuData = [] + floatingToolBox = [] + menuData = [ + { + name: '鐩綍', + icon: mulu, + isShow: bookConfig.value.textbookComponents.indexOf('1E16353F') > -1 + }, + { + name: '绗旇', + icon: biji, + isShow: bookConfig.value.textbookComponents.indexOf('A3298FCF') > -1 + }, + { + name: '璧勬簮', + icon: ziyuan, + isShow: bookConfig.value.textbookComponents.indexOf('A04689E6') > -1 + }, + { + name: '鐭ヨ瘑鍥捐氨', + icon: zhishitupu, + isShow: bookConfig.value.textbookComponents.indexOf('6BE6A3DC') > -1 + }, + { + name: '鎴浘', + icon: jietu, + isShow: bookConfig.value.textbookComponents.indexOf('CB0EACEC') > -1 + }, + { + name: '涔︾', + icon: biaoqian, + isShow: bookConfig.value.textbookComponents.indexOf('CF2E1400') > -1 + } + ]; + teachToolsMenuData = [ + { + name: 'AI鏅鸿兘闂瓟', + icon: aIzhinengwenda, + isShow: bookConfig.value.textbookComponents.indexOf('E30C0843') > -1 + }, + { + name: '璇嶅吀', + icon: cidian, + isShow: bookConfig.value.textbookComponents.indexOf('83FB80FD') > -1 + }, + { + name: '鐢熷瓧鍗$墖', + icon: shengzikapian, + isShow: bookConfig.value.textbookComponents.indexOf('38D32EE3') > -1 + }, + { + name: '浜掑姩闂瓟', + icon: hudongwenda, + isShow: bookConfig.value.textbookComponents.indexOf('31F123A4') > -1 + }, + { + name: '鎬濈淮瀵煎浘', + icon: siweidaotu, + isShow: bookConfig.value.textbookComponents.indexOf('94FF5E48') > -1 + }, + { + name: 'GGB鍑芥暟宸ュ叿', + icon: GGB, + isShow: bookConfig.value.textbookComponents.indexOf('43C805B2') > -1 + }, + { + name: '鍑犱綍宸ュ叿', + icon: jihe, + isShow: bookConfig.value.textbookComponents.indexOf('FFFED2EF') > -1 + }, + { + name: 'Python', + icon: python, + isShow: bookConfig.value.textbookComponents.indexOf('1D48E00E') > -1 + }, + { + name: 'C++', + icon: cjiajia, + isShow: bookConfig.value.textbookComponents.indexOf('8E953BF7') > -1 + }, + { + name: 'Javascript', + icon: javascript, + isShow: bookConfig.value.textbookComponents.indexOf('25AC6CC2') > -1 + }, + { + name: '妯″瀷宸ュ叿', + icon: moxinggongju, + isShow: bookConfig.value.textbookComponents.indexOf('366F6CF3') > -1 + } + ]; + floatingToolBox = [ + { + icon: huabi, + activeIcon: huabi1, + name: '鐢荤瑪', + isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1 + }, + { + activeIcon: baiban1, + icon: baiban, + name: '鐧芥澘', + isShow: false + }, + { + activeIcon: biaozhu1, + icon: biaozhu, + name: '鏍囪', + isShow: bookConfig.value.textbookComponents.indexOf('2E613A8F') > -1 + }, + { + activeIcon: biaoqian1, + icon: biaoqianw, + name: '涔︾', + isShow: bookConfig.value.textbookComponents.indexOf('D2D30448') > -1 + }, + { + activeIcon: jieping1, + icon: jieping, + name: '鎴睆', + isShow: bookConfig.value.textbookComponents.indexOf('86F0A1B8') > -1 + } + ] +} //鑾峰彇鐩綍 const catalogueData = ref([]) @@ -1340,33 +1468,7 @@ searchShow.value = true } } -// 鑿滃崟 -const menuData = reactive([ - { - name: '鐩綍', - icon: mulu - }, - { - name: '绗旇', - icon: biji - }, - { - name: '璧勬簮', - icon: ziyuan - }, - { - name: '鐭ヨ瘑鍥捐氨', - icon: zhishitupu - }, - { - name: '鎴浘', - icon: jietu - }, - { - name: '涔︾', - icon: biaoqian - } -]) + // 閫変腑鑿滃崟 const activeMenu = ref('鐩綍') @@ -1507,53 +1609,6 @@ } } -// 鍙充晶宸ュ叿 -const teachToolsMenuData = reactive([ - { - name: 'AI鏅鸿兘闂瓟', - icon: aIzhinengwenda - }, - { - name: '璇嶅吀', - icon: cidian - }, - { - name: '鐢熷瓧鍗$墖', - icon: shengzikapian - }, - { - name: '浜掑姩闂瓟', - icon: hudongwenda - }, - { - name: '鎬濈淮瀵煎浘', - icon: siweidaotu - }, - { - name: 'GGB鍑芥暟宸ュ叿', - icon: GGB - }, - { - name: '鍑犱綍宸ュ叿', - icon: jihe - }, - { - name: 'Python', - icon: python - }, - { - name: 'C++', - icon: cjiajia - }, - { - name: 'Javascript', - icon: javascript - }, - { - name: '妯″瀷宸ュ叿', - icon: moxinggongju - } -]) const baiduVisible = ref(false) const wendaVisible = ref(false) const cidianVisible = ref(false) @@ -1611,33 +1666,7 @@ } //鐢诲竷鎮诞鎿嶄綔 -const floatingToolBox = reactive([ - { - icon: huabi, - activeIcon: huabi1, - name: '鐢荤瑪' - }, - { - activeIcon: baiban1, - icon: baiban, - name: '鐧芥澘' - }, - { - activeIcon: biaozhu1, - icon: biaozhu, - name: '鏍囪' - }, - { - activeIcon: biaoqian1, - icon: biaoqianw, - name: '涔︾' - }, - { - activeIcon: jieping1, - icon: jieping, - name: '鎴睆' - } -]) + let canvas = null const floatingToolData = reactive({ activeToolData: '', //閫変腑宸ュ叿 @@ -3238,7 +3267,7 @@ } .menu { padding-top: 20px; - li { + li > div { // height: 50px; padding: 10px 36px; font-size: 16px; -- Gitblit v1.9.1