Browse Source

列表添加排序

wangtao 1 week ago
parent
commit
fcd4f8d3d2

+ 6 - 5
src/assets/styles/common/style.css

@@ -876,7 +876,8 @@
             
             header .mainmenu-area .main-menu .menu-items ul li:hover .submenu {
                 opacity: 1;
-                visibility: visible
+                visibility: visible;
+                background: rgba(0,0,0,0.1);
             }
             /* header .mainmenu-area .main-menu .menu-items ul li:hover a , header .mainmenu-area .main-menu .menu-items ul li.active>a{
                 color: #409eff;
@@ -902,17 +903,17 @@
             
             header .mainmenu-area .main-menu .menu-items ul li .submenu {
                 position: absolute;
-                left: 0;
-                text-align: center;
                 top: 120%;
-                width: 100%;
+                left:10%;
+                width: 80%;
+                text-align: center;
                 /* margin-left:10%; */
                 /* background-color: #fff; */
                 opacity: 0;
                 visibility: hidden;
                 -webkit-transition: all 0.3s ease-out 0s;
                 transition: all 0.3s ease-out 0s;
-                z-index: 99;
+                z-index: 9999;
                 /* box-shadow: 0px 10px 20px 10px rgba(170, 170, 170, 0.1);
                 -webkit-box-shadow: 0px 10px 20px 10px rgba(170, 170, 170, 0.1);
                 -moz-box-shadow: 0px 10px 20px 10px rgba(170, 170, 170, 0.1); */

+ 48 - 6
src/components/layout/header.vue

@@ -26,6 +26,7 @@ function handleClose(){
 function dialogPersona(){
     store.commit("setDialogPersonalStatus",true)
 }
+console.log(store.state.menuList,123)
 if(typeof window !== 'undefined' && typeof window.globalThis.addEventListener === 'function') {
     globalThis.addEventListener('scroll', function() {
         var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
@@ -74,11 +75,16 @@ if(typeof window !== 'undefined' && typeof window.globalThis.addEventListener ==
                                     >
                                         <a  :href="item.sname ? `${item.path}?dup=${item.sname}` : item.path
                                             ">{{item.categoryName}}</a>
-                                            <ul class="submenu">
-                                                <li v-if="item.children" v-for="children in item.children" :key="children.id">
-                                                    <a  :href="item.sname ? `${item.path}?dup=${item.sname}&categoryid=${children.id}&isUrlId=1` : `${item.path}?categoryid=${children.id}&isUrlId=1` "> 
+                                            <ul class="submenu" v-if="item.children">
+                                                <li v-for="children in item.children" :key="children.id" class="submenu-item" style="display: inblock !important;vertical-align: top;">
+                                                    <a  :href="item.sname ? `${item.path}?dup=${item.sname}&categoryid=${children.id}&isUrlId=1` : `${item.path}?categoryid=${children.id}&isUrlId=1` " class="level2"> 
                                                         <span style="font-weight:bold;margin-right:10px">·</span>
-                                                        {{children.categoryName}}
+                                                        <span>{{children.categoryName}}</span>
+                                                        <ul class="submenu2" v-if="children?.children.length>0">
+                                                            <li v-for="(children2,index) in children.children" :key="index" class="submenu2Li" style="">
+                                                                <a href="">{{ children2.categoryName }}</a>
+                                                            </li>
+                                                        </ul>
                                                     </a>
                                                 </li>
                                             </ul>
@@ -135,6 +141,42 @@ if(typeof window !== 'undefined' && typeof window.globalThis.addEventListener ==
             </div>
         </header>
 </template>
-<style lang="scss" scoped>
-
+<style lang="scss" >
+.level2{
+    position: relative;
+}
+.level2>span{
+    color:#fff;
+}
+.level2:hover{
+    >span{
+        color:#409EFF;
+    }
+    .submenu2{
+        display: block;
+    }
+    
+}
+.submenu2{
+    text-align: center;
+    display: none;
+    width:100% !important;
+    overflow: hidden;
+    padding:0 0 10px 18px !important;
+    margin:0 !important;
+    .submenu2Li{
+        display: block !important;
+        margin:-10px 0 0 0px  !important;
+        height:30px !important;
+        width:100% !important;
+        a{
+            height:20px !important;
+            line-height: 20px !important;
+            text-align:left;
+            padding:0 !important;
+            font-size: 15px !important;
+        }
+        
+    }
+}
 </style>

+ 4 - 1
src/store/index.ts

@@ -163,7 +163,10 @@ export const store = createStore({
                                 }
                             }
                         }
-                    commit('setMenuList',res.data)
+                        var a = JSON.parse(JSON.stringify(res.data))
+                        a[3].children[0].children = res.data[1].children
+                        commit('setMenuList',a)
+                    // commit('setMenuList',res.data)
                     resolve(true)
                 })
             })

+ 1 - 0
src/views/about/index.vue

@@ -76,6 +76,7 @@ export default defineComponent({
                             categoryid: data[i].id,
                             pageNum:1,
                             pageSize:100,
+                            order:"sortindex",
                         },
                         index:params.path,
                         sub:i

+ 1 - 0
src/views/cases/index.vue

@@ -81,6 +81,7 @@ export default defineComponent({
                             categoryid: data[i].id,
                             pageNum:1,
                             pageSize:100,
+                            order:"sortindex",
                         },
                         index:params.path,
                         sub:i

+ 1 - 0
src/views/index/index.vue

@@ -45,6 +45,7 @@ export default defineComponent({
                             categoryid: data[i].id,
                             pageNum:1,
                             pageSize:100,
+                            order:"sortindex",
                         },
                         index:params.path,
                         sub:i