Browse Source

feat(上海cim平台):

1.应用赋能平台菜单高亮
胡荣基 8 months ago
parent
commit
9d79e0547f

+ 31 - 14
src/views/power-home/index.vue

@@ -13,21 +13,27 @@
           <div class="more-t">
             <template v-for="(item,index) in headerTitle" :key="item.name">
               <div v-if="!item.children" class="el-dropdown"><p
-                  @click="() => item.linkHref == '/power-home' ? router.push(item.linkHref):''"
+                  @click="clickHome"
                   class="more-t-item el-tooltip__trigger el-tooltip__trigger"
-                  aria-haspopup="menu">{{ item.name }}</p>
+                  :style="selectedHead == item.name ?  {color: '#2e4eda'}:{}"
+                  aria-haspopup="menu"
+              >{{ item.name }}</p>
               </div>
-              <el-dropdown v-else>
-                <span class="more-t-item">{{
+              <el-dropdown v-else @command="handleCommand">
+                <span class="more-t-item" :style="selectedHead == item.name ?  {color: '#2e4eda'}:{}">{{
                     item.name
                   }}</span>
                 <template #dropdown>
                   <el-dropdown-menu>
-                    <el-dropdown-item @click="linkToOther(item2,getDisabled(item2))"
-                                      :key="item2.name" v-for="item2 in item.children"
-                                      :class="{'disabled':item2.disabled ||
+                    <el-dropdown-item
+                        :style="selectedItem == item2.name ?  {color: '#2e4eda'}:{}"
+                        :command="item2.name"
+                        @click="linkToOther(item2,getDisabled(item2),item.name)"
+                        :key="item2.name" v-for="item2 in item.children"
+                        :class="{'disabled':item2.disabled ||
                                 (!item2.isZi && !loginPinia.canSeeSystemArr.find(i => +i.MODULE_ID === +item2.moduleId)),
-                                'not-login':getDisabled(item2)}">{{ item2.name }}
+                                'not-login':getDisabled(item2),
+                                'highlight': item2.name === selectedItem }">{{ item2.name }}
                     </el-dropdown-item>
                   </el-dropdown-menu>
                 </template>
@@ -70,6 +76,12 @@ import {handleMes, showMessage} from "@/unit/element-ui/tip";
 
 const router = useRouter()
 
+const selectedItem = ref('')
+const selectedHead = ref('')
+
+function handleCommand(command) {
+  selectedItem.value = command;
+}
 
 function loginZHFXFN(type, url) {
 
@@ -122,7 +134,7 @@ function loginZHFXFN(type, url) {
 
 }
 
-function toPage(item, isDisabled) {
+function toPage(item, isDisabled, headName) {
   // console.log('点击', item, isDisabled)
   debugger
   let path = isDisabled ? item.loginPage : item.linkHref
@@ -130,6 +142,8 @@ function toPage(item, isDisabled) {
     if (path.indexOf("http://") > -1 || path.indexOf("https://") > -1) {
       window.open(path, path)
     } else {
+      // 记录父名称
+      selectedHead.value = headName
       router.push({name: 'interface', params: {type: item.type}})
     }
     return
@@ -409,6 +423,11 @@ function loginZW(type, url) {
       })
 }
 
+function clickHome() {
+  selectedHead.value = '首页'
+  router.push('/power-home')
+}
+
 function selectUserModule(user_id, url) {
   var json_data = {
     "user_id": user_id
@@ -780,7 +799,7 @@ function getDisabled(child) {
   return !loginPinia.canSeeSystemArr.find(i => +i.MODULE_ID === +child.moduleId) && child.isZi
 }
 
-function linkToOther(item, isDisabled) {
+function linkToOther(item, isDisabled, headName) {
   debugger
   if (!item.disabled) {
     if (item.linkHref) {
@@ -789,12 +808,9 @@ function linkToOther(item, isDisabled) {
         return
 
       }
-      toPage(item, isDisabled)
-      // window.open(item.linkHref,item.linkHref)
+      toPage(item, isDisabled, headName)
     }
   }
-
-
 }
 </script>
 
@@ -875,6 +891,7 @@ function linkToOther(item, isDisabled) {
     color: #272727;
   }
 }
+
 </style>
 
 

+ 1 - 11
src/views/power-home/interface/InterfaceUtil.vue

@@ -1,12 +1,7 @@
 <template>
   <div class="container">
     <div>
-      <el-row>
-        <el-col :span="4" :push="2" style="padding-bottom: 10px">
-          <el-page-header @back="goBack" :content="title">
-          </el-page-header>
-        </el-col>
-      </el-row>
+
       <el-row :gutter="20">
         <el-col :span="3">
           <div class="grid-content bg-purple"></div>
@@ -73,11 +68,6 @@ function getImagePath(name) {
   }
 }
 
-
-function goBack() {
-  router.go(-1)
-}
-
 function jump(name, type, action) {
   router.push({name: name, params: {type: type, action: action}})
 }

+ 23 - 2
src/views/power-home/interface/interface-page.vue

@@ -2,6 +2,12 @@
   <div>
     <card-page>
       <template v-slot:card-header>
+        <el-row>
+          <el-col :span="4" style="padding-bottom: 5px;">
+            <el-page-header @back="goBack"  :content="action">
+            </el-page-header>
+          </el-col>
+        </el-row>
         <el-row :gutter="20">
           <el-col :span="18">
             <el-form :inline="true" :model="formData" ref="formDataRef">
@@ -64,7 +70,8 @@
                   <el-table-column min-width="180">
                     <template #default="{ row }">
                       <div class="center" style="justify-content: left">
-                        <img :src="row.SLT_URL" @error="onImageError" style="min-width: 346px"/>
+                        <!--                        <img :src="row.SLT_URL" @error="onImageError" style="min-width: 346px"/>-->
+                        <img src="@/assets/imgs/interfaceTool.png" style="min-width: 346px"/>
                         <div style="padding-left: 10px">
                           <p>
                             <span class="title-font">{{ row.RESOURCE_NAME }}</span><br>
@@ -99,7 +106,9 @@
                         <i class="iconfont icon-shoucang1" @click="canceltCollection(row.COLLECTION_FLAG)"
                            v-else
                            style="color: #edd25b;padding-right: 20px"></i>
-                        <el-button class="button-font" type="primary" @click="onLineTest(row)" plain :disabled="!!!row.TEXT_ADDRESS">在线测试</el-button>
+                        <el-button class="button-font" type="primary" @click="onLineTest(row)" plain
+                                   :disabled="!!!row.TEXT_ADDRESS">在线测试
+                        </el-button>
                         <el-button class="button-font" type="primary" @click="getDetails(row)" plain>查看详情
                         </el-button>
                         <el-button class="button-font" type="primary" @click="jumpTool(row)" plain>申请资源
@@ -243,6 +252,10 @@ const page = ref({
   total: 0,
 });
 
+function goBack() {
+  router.go(-1)
+}
+
 
 // dom加载完成
 onMounted(() => {
@@ -283,6 +296,7 @@ function onLineTest(data) {
   }
   window.open(data.TEXT_ADDRESS)
 }
+
 // 查看详情
 function getDetails(data) {
   if (data == null) {
@@ -613,4 +627,11 @@ function objectSpanMethod({row, column, rowIndex, columnIndex}) {
   // 选择隐藏
   background-color: transparent !important;
 }
+
+// 页头样式
+:deep .el-page-header__content {
+  font-size: 15px;
+  color: #5c6160;
+  font-weight: 500;
+}
 </style>