Sfoglia il codice sorgente

feat: indent主模块.嵌入分析页面.

peter 3 settimane fa
parent
commit
8705aeea36

+ 1 - 1
src/pages/indent-manage/indent/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="page-indent-list py-4 px-2 shadow max-w-[1800px] mx-auto">
+  <div class="bg-white page-indent-list py-4 px-2 shadow max-w-[1800px] mx-auto">
     <el-form
       ref="searchForm"
       v-loading="loading"

+ 30 - 3
src/pages/indent-manage/index.vue

@@ -10,7 +10,7 @@
           <div
             v-for="item in navList"
             :key="item.key"
-            @click="$router.push(item.path)"
+            @click="onRouteClick(item.path)"
             class="cursor-pointer h-[100%] w-[100px] leading-[48px] px-4 no-underline text-white hover:font-bold flex justify-center"
             :class="{
               'font-bold': currentPath === item.key,
@@ -19,14 +19,32 @@
           >
             {{ item.key }}
           </div>
+
+          <div
+            v-if="indentID === '1' || indentName === 'admin'"
+            @click="showIndent = false"
+            class="cursor-pointer h-[100%] w-[100px] leading-[48px] px-4 no-underline text-white hover:font-bold flex justify-center"
+          >
+            Analysis
+          </div>
         </div>
       </div>
     </div>
-    <router-view class="bg-white" />
+
+    <router-view
+      v-if="showIndent"
+      class="bg-white"
+    />
+    <iframe
+      v-else
+      src="https://app.powerbi.com/view?r=eyJrIjoiOTBkNmM3NGUtYjkzZi00NmVjLTk4ZTYtNjQ2ZmU2YjA3NTdhIiwidCI6ImE0OGUxYWZlLWZjODQtNDAxYi04Nzc1LTdkMGVlYmE3YzlkOCIsImMiOjEwfQ%3D%3D"
+      frameborder="0"
+      class="w-[100%] h-[calc(100vh-48px)]"
+    ></iframe>
   </div>
 </template>
 <script lang="ts" setup>
-import { defineComponent, provide, computed } from 'vue'
+import { defineComponent, provide, computed, ref, nextTick } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import Cookie from 'js-cookie'
 defineComponent({
@@ -99,6 +117,15 @@ let currentPath = computed(() => {
   }
   return result
 })
+let indentID = ref(Cookie.get('indent-id') || '')
+let indentName = ref(Cookie.get('indent-user') || '')
+let showIndent = ref(true)
+let onRouteClick = (path: string) => {
+  showIndent.value = true
+  nextTick(() => {
+    $router.push(path)
+  })
+}
 </script>
 <style>
 .bg-white {

+ 1 - 1
src/pages/indent-manage/product/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="page-indent-list py-4 px-2 shadow max-w-[1800px] mx-auto">
+  <div class="bg-white page-indent-list py-4 px-2 shadow max-w-[1800px] mx-auto">
     <el-form
       ref="searchForm"
       :inline="true"

+ 1 - 1
src/pages/indent-manage/supplier/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="page-indent-list py-4 px-2 shadow max-w-[1800px] mx-auto">
+  <div class="bg-white page-indent-list py-4 px-2 shadow max-w-[1800px] mx-auto">
     <el-form
       ref="searchForm"
       :inline="true"