Selaa lähdekoodia

Merge branch 'fix_env' of ruiqigogs/yf-portal-vue into master

yanghao 2 viikkoa sitten
vanhempi
commit
75a7308a33
5 muutettua tiedostoa jossa 199 lisäystä ja 191 poistoa
  1. 1 1
      src/App.vue
  2. 21 21
      src/components/home/CardItem.vue
  3. 141 134
      src/components/home/header.vue
  4. 25 21
      src/views/index.vue
  5. 11 14
      src/views/login.vue

+ 1 - 1
src/App.vue

@@ -4,7 +4,7 @@ import { motion } from "motion-v";
 
 <template>
   <motion.div
-    class="overflow-x-hidden"
+    class="overflow-x-hidden font-sans"
     :key="$route.fullPath"
     :initial="{ opacity: 0 }"
     :animate="{ opacity: 1, transition: { duration: 0.5, ease: 'easeOut' } }"

+ 21 - 21
src/components/home/CardItem.vue

@@ -130,32 +130,32 @@ const props = defineProps<{
 
 // 创建图标映射表
 const iconMap: Record<string, string> = {
-  OA办公系统: oaimage,
-  经营驾驶舱: driveimage,
-  战略解码与执行: zhanlueimage,
-  "财务管理(收入、成本、应收账款)": erpimage,
-  技术研发管理: jishuimage,
+  "办公系统(OA)": oaimage,
+  "经营驾驶舱(OC)": driveimage,
+  "战略解码与执行(SDM)": zhanlueimage,
+  "财务管理(FM)": erpimage,
+  "技术研发管理(RD)": jishuimage,
   "客户管理(CRM)": crmimage,
   "人力资源(EHR)": ehrimage,
   "供应链管理(SCM)": scmimage,
-  组织资产管理: zuzhiimage,
-  "风控、合规管理": safeimage,
-  中航北斗智慧管理系统: zhonghangimage,
-  智能钻井系统: zuanjingimage,
-  智能压裂系统: yalieimage,
-  智能注气系统: zhuqiimage,
-  智能连油系统: lianyouimage,
-  "QHSE (安全监控、应急指挥)": qhseimage,
+  "组织资产管理(AM)": zuzhiimage,
+  "风控、合规管理(ECM)": safeimage,
+  "中航北斗(ZH)": zhonghangimage,
+  "智能钻井系统(IDS)": zuanjingimage,
+  "智能压裂系统(IFS)": yalieimage,
+  "智能注气系统(IGIS)": zhuqiimage,
+  "智能连油系统(ICOTS)": lianyouimage,
+  "安全应急(QHSE)": qhseimage,
   "设备管理系统 (PMS)": pmsimage,
   "项目管理 (PM)": pmimage,
-  "全局数据治理 (数据中台)": dataimage,
-  智能决策: thinkimage,
-  行业AI大模型: aiimage,
-  "AI智能体 (智能交互)": agentimage,
+  "全局数据治理(DG)": dataimage,
+  "智能决策(DI)": thinkimage,
+  "行业AI大模型(LM)": aiimage,
+  "AI智能体(Agent)": agentimage,
 };
 const isSpecialSystem = (label: string) => {
   const specialSystems = [
-    "OA办公系统",
+    "办公系统(OA)",
     "客户管理(CRM)",
     "设备管理系统 (PMS)",
     "中航北斗智慧管理系统",
@@ -180,7 +180,7 @@ const goDetail = () => {
 
 // 处理查看按钮点击事件
 const handleView = async (item: Item) => {
-  if (item.label === "OA办公系统") {
+  if (item.label === "办公系统(OA)") {
     if (userStore.getUser.username && getAccessToken()) {
       const res = await ssoLogin({
         username: userStore.getUser.username,
@@ -210,7 +210,7 @@ const handleView = async (item: Item) => {
     }
   }
 
-  if (item.label === "中航北斗智慧管理系统") {
+  if (item.label === "中航北斗(ZH)") {
     // window.open("https://zhbdgps.cn", "_blank");
     if (userStore.getUser.username && getAccessToken()) {
       window.open("https://zhbdgps.cn", "_blank");
@@ -228,7 +228,7 @@ const handleView = async (item: Item) => {
     }
   }
 
-  if (item.label === "智能连油系统") {
+  if (item.label === "智能连油系统(ICOTS)") {
     const extraParam = "source=zhly";
     if (userStore.getUser.username && getAccessToken()) {
       window.open(

+ 141 - 134
src/components/home/header.vue

@@ -2,7 +2,9 @@
   <header
     class="fixed w-full top-0 z-100 bg-white border-b border-[#f0f2f5] shadow-sm"
   >
-    <div class="w-full mx-auto flex items-center justify-between py-3 px-10">
+    <div
+      class="w-full mx-auto flex items-center justify-between px-10 pr-0 h-18"
+    >
       <div class="flex items-center gap-2 cursor-pointer" @click="goHome">
         <img :src="logo" alt="logo" class="w-20 h-9" />
         <span class="text-[#02409b] text-[20px] font-bold border-l-2 pl-1"
@@ -10,7 +12,7 @@
         >
       </div>
 
-      <nav class="hidden lg:flex flex-1 mx-4">
+      <nav class="hidden lg:flex flex-1 mx-4 ml-10 text-sm">
         <ul class="flex items-center gap-6 text-[#303133]">
           <li><a class="hover:text-[#409EFF] cursor-pointer">产品</a></li>
           <li><a class="hover:text-[#409EFF] cursor-pointer">解决方案</a></li>
@@ -21,136 +23,141 @@
         </ul>
       </nav>
 
-      <div class="hidden lg:flex items-center gap-3">
-        <div class="flex items-center gap-3">
-          <a class="text-[#606266] cursor-pointer">控制台</a>
-          <template v-if="isLoggedIn">
-            <el-dropdown @command="onUserCommand" trigger="click">
-              <span class="flex items-center gap-2 cursor-pointer">
-                <div class="avatar-wrapper">
-                  <img
-                    :src="userAvatar || person"
-                    alt="avatar"
-                    class="w-8 h-8 rounded-full avatar-image"
-                  />
-                </div>
-                <span class="text-sm text-[#303133]">{{ userName }}</span>
-              </span>
-              <template #dropdown>
-                <el-dropdown-menu>
-                  <el-dropdown-item command="profile"
-                    ><svg
-                      xmlns="http://www.w3.org/2000/svg"
-                      width="18"
-                      height="18"
-                      viewBox="0 0 16 16"
-                    >
-                      <g fill="none">
-                        <path
-                          fill="url(#SVG3BqCJdyi)"
-                          d="M11.5 8A1.5 1.5 0 0 1 13 9.5v.5c0 1.971-1.86 4-5 4s-5-2.029-5-4v-.5A1.5 1.5 0 0 1 4.5 8z"
-                        />
-                        <path
-                          fill="url(#SVGfKhxtenh)"
-                          d="M11.5 8A1.5 1.5 0 0 1 13 9.5v.5c0 1.971-1.86 4-5 4s-5-2.029-5-4v-.5A1.5 1.5 0 0 1 4.5 8z"
-                        />
-                        <path
-                          fill="url(#SVGJYCMTblH)"
-                          d="M8 1.5A2.75 2.75 0 1 1 8 7a2.75 2.75 0 0 1 0-5.5"
-                        />
-                        <defs>
-                          <linearGradient
-                            id="SVG3BqCJdyi"
-                            x1="5.378"
-                            x2="7.616"
-                            y1="8.798"
-                            y2="14.754"
-                            gradientUnits="userSpaceOnUse"
-                          >
-                            <stop offset=".125" stop-color="#9c6cfe" />
-                            <stop offset="1" stop-color="#7a41dc" />
-                          </linearGradient>
-                          <linearGradient
-                            id="SVGfKhxtenh"
-                            x1="8"
-                            x2="11.164"
-                            y1="7.286"
-                            y2="17.139"
-                            gradientUnits="userSpaceOnUse"
-                          >
-                            <stop stop-color="#885edb" stop-opacity="0" />
-                            <stop offset="1" stop-color="#e362f8" />
-                          </linearGradient>
-                          <linearGradient
-                            id="SVGJYCMTblH"
-                            x1="6.558"
-                            x2="9.361"
-                            y1="2.231"
-                            y2="6.707"
-                            gradientUnits="userSpaceOnUse"
-                          >
-                            <stop offset=".125" stop-color="#9c6cfe" />
-                            <stop offset="1" stop-color="#7a41dc" />
-                          </linearGradient>
-                        </defs>
-                      </g>
-                    </svg>
-                    <span class="pl-2">个人中心</span>
-                  </el-dropdown-item>
-                  <el-dropdown-item command="logout"
-                    ><svg
-                      xmlns="http://www.w3.org/2000/svg"
-                      width="18"
-                      height="18"
-                      viewBox="0 0 24 24"
-                    >
-                      <g fill="none">
-                        <path
-                          fill="url(#SVG0pAmxd9w)"
-                          d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2"
-                        />
-                        <path
-                          fill="url(#SVGFnXqmeDt)"
-                          d="m15.53 8.47l-.084-.073a.75.75 0 0 0-.882-.007l-.094.08L12 10.939l-2.47-2.47l-.084-.072a.75.75 0 0 0-.882-.007l-.094.08l-.073.084a.75.75 0 0 0-.007.882l.08.094L10.939 12l-2.47 2.47l-.072.084a.75.75 0 0 0-.007.882l.08.094l.084.073a.75.75 0 0 0 .882.007l.094-.08L12 13.061l2.47 2.47l.084.072a.75.75 0 0 0 .882.007l.094-.08l.073-.084a.75.75 0 0 0 .007-.882l-.08-.094L13.061 12l2.47-2.47l.072-.084a.75.75 0 0 0 .007-.882z"
-                        />
-                        <defs>
-                          <linearGradient
-                            id="SVG0pAmxd9w"
-                            x1="5.125"
-                            x2="18.25"
-                            y1="3.25"
-                            y2="22.625"
-                            gradientUnits="userSpaceOnUse"
-                          >
-                            <stop stop-color="#f83f54" />
-                            <stop offset="1" stop-color="#ca2134" />
-                          </linearGradient>
-                          <linearGradient
-                            id="SVGFnXqmeDt"
-                            x1="8.685"
-                            x2="12.591"
-                            y1="12.332"
-                            y2="16.392"
-                            gradientUnits="userSpaceOnUse"
-                          >
-                            <stop stop-color="#fdfdfd" />
-                            <stop offset="1" stop-color="#fecbe6" />
-                          </linearGradient>
-                        </defs>
-                      </g>
-                    </svg>
-                    <span class="pl-2">退出登录</span></el-dropdown-item
-                  >
-                </el-dropdown-menu>
-              </template>
-            </el-dropdown>
-          </template>
-          <template v-else>
-            <el-button type="primary" class="bg-[#0050b3]!" @click="login"
-              >登录</el-button
-            >
-          </template>
+      <div class="hidden lg:flex items-center gap-3 h-full">
+        <div class="flex items-center gap-2 cursor-pointer">
+          <Icon icon="mdi:server" class="w-4 h-4" />
+          <span class="text-sm">控制台</span>
         </div>
+
+        <template v-if="isLoggedIn">
+          <el-dropdown @command="onUserCommand" trigger="click">
+            <span class="flex items-center gap-2 cursor-pointer pr-2">
+              <div class="avatar-wrapper">
+                <img
+                  :src="userAvatar || person"
+                  alt="avatar"
+                  class="w-8 h-8 rounded-full avatar-image"
+                />
+              </div>
+              <span class="text-sm text-[#303133]">{{ userName }}</span>
+            </span>
+            <template #dropdown>
+              <el-dropdown-menu>
+                <el-dropdown-item command="profile">
+                  <svg
+                    xmlns="http://www.w3.org/2000/svg"
+                    width="18"
+                    height="18"
+                    viewBox="0 0 16 16"
+                  >
+                    <g fill="none">
+                      <path
+                        fill="url(#SVG3BqCJdyi)"
+                        d="M11.5 8A1.5 1.5 0 0 1 13 9.5v.5c0 1.971-1.86 4-5 4s-5-2.029-5-4v-.5A1.5 1.5 0 0 1 4.5 8z"
+                      />
+                      <path
+                        fill="url(#SVGfKhxtenh)"
+                        d="M11.5 8A1.5 1.5 0 0 1 13 9.5v.5c0 1.971-1.86 4-5 4s-5-2.029-5-4v-.5A1.5 1.5 0 0 1 4.5 8z"
+                      />
+                      <path
+                        fill="url(#SVGJYCMTblH)"
+                        d="M8 1.5A2.75 2.75 0 1 1 8 7a2.75 2.75 0 0 1 0-5.5"
+                      />
+                      <defs>
+                        <linearGradient
+                          id="SVG3BqCJdyi"
+                          x1="5.378"
+                          x2="7.616"
+                          y1="8.798"
+                          y2="14.754"
+                          gradientUnits="userSpaceOnUse"
+                        >
+                          <stop offset=".125" stop-color="#9c6cfe" />
+                          <stop offset="1" stop-color="#7a41dc" />
+                        </linearGradient>
+                        <linearGradient
+                          id="SVGfKhxtenh"
+                          x1="8"
+                          x2="11.164"
+                          y1="7.286"
+                          y2="17.139"
+                          gradientUnits="userSpaceOnUse"
+                        >
+                          <stop stop-color="#885edb" stop-opacity="0" />
+                          <stop offset="1" stop-color="#e362f8" />
+                        </linearGradient>
+                        <linearGradient
+                          id="SVGJYCMTblH"
+                          x1="6.558"
+                          x2="9.361"
+                          y1="2.231"
+                          y2="6.707"
+                          gradientUnits="userSpaceOnUse"
+                        >
+                          <stop offset=".125" stop-color="#9c6cfe" />
+                          <stop offset="1" stop-color="#7a41dc" />
+                        </linearGradient>
+                      </defs>
+                    </g>
+                  </svg>
+                  <span class="pl-2">个人中心</span>
+                </el-dropdown-item>
+                <el-dropdown-item command="logout">
+                  <svg
+                    xmlns="http://www.w3.org/2000/svg"
+                    width="18"
+                    height="18"
+                    viewBox="0 0 24 24"
+                  >
+                    <g fill="none">
+                      <path
+                        fill="url(#SVG0pAmxd9w)"
+                        d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2"
+                      />
+                      <path
+                        fill="url(#SVGFnXqmeDt)"
+                        d="m15.53 8.47l-.084-.073a.75.75 0 0 0-.882-.007l-.094.08L12 10.939l-2.47-2.47l-.084-.072a.75.75 0 0 0-.882-.007l-.094.08l-.073.084a.75.75 0 0 0-.007.882l.08.094L10.939 12l-2.47 2.47l-.072.084a.75.75 0 0 0-.007.882l.08.094l.084.073a.75.75 0 0 0 .882.007l.094-.08L12 13.061l2.47 2.47l.084.072a.75.75 0 0 0 .882.007l.094-.08l.073-.084a.75.75 0 0 0 .007-.882l-.08-.094L13.061 12l2.47-2.47l.072-.084a.75.75 0 0 0 .007-.882z"
+                      />
+                      <defs>
+                        <linearGradient
+                          id="SVG0pAmxd9w"
+                          x1="5.125"
+                          x2="18.25"
+                          y1="3.25"
+                          y2="22.625"
+                          gradientUnits="userSpaceOnUse"
+                        >
+                          <stop stop-color="#f83f54" />
+                          <stop offset="1" stop-color="#ca2134" />
+                        </linearGradient>
+                        <linearGradient
+                          id="SVGFnXqmeDt"
+                          x1="8.685"
+                          x2="12.591"
+                          y1="12.332"
+                          y2="16.392"
+                          gradientUnits="userSpaceOnUse"
+                        >
+                          <stop stop-color="#fdfdfd" />
+                          <stop offset="1" stop-color="#fecbe6" />
+                        </linearGradient>
+                      </defs>
+                    </g>
+                  </svg>
+                  <span class="pl-2">退出登录</span>
+                </el-dropdown-item>
+              </el-dropdown-menu>
+            </template>
+          </el-dropdown>
+        </template>
+        <template v-else>
+          <div
+            class="bg-[#0050b3] hover:bg-[#0050b3]/90 text-white text-sm flex items-center justify-center cursor-pointer h-full px-10 py-4"
+            @click="login"
+          >
+            登录
+          </div>
+        </template>
       </div>
 
       <div class="lg:hidden">
@@ -177,8 +184,8 @@
           <li><a class="block py-2">开源社区</a></li>
         </ul>
         <div class="flex items-center gap-3 mt-3">
-          <el-button type="primary" class="flex-1 bg-[#0050b3]!"
-            >登录 / 注册</el-button
+          <el-button type="primary" class="flex-1 bg-[#0050b3]!" @click="login"
+            >登录</el-button
           >
         </div>
       </div>
@@ -196,7 +203,7 @@ import { useUserStoreWithOut } from "@/stores/useUserStore";
 const userStore = useUserStoreWithOut();
 
 const isLoggedIn = computed(
-  () => !!userStore.isSetUser || !!userStore.user?.id
+  () => !!userStore.isSetUser || !!userStore.user?.id,
 );
 const userAvatar = computed(() => userStore.user?.avatar || "");
 const userName = computed(() => userStore.user?.nickname || "");

+ 25 - 21
src/views/index.vue

@@ -2,7 +2,9 @@
   <div class="bg-white">
     <Header />
 
-    <section class="relative w-full h-[25vh] md:h-[25vh] overflow-hidden mt-15">
+    <section
+      class="relative w-full h-[30vh] md:h-[25vh] overflow-hidden mt-15 md:pb-5 pb-30"
+    >
       <video
         class="absolute inset-0 w-full h-full object-cover"
         :src="bgVideo"
@@ -12,7 +14,9 @@
         playsinline
       ></video>
       <div class="absolute inset-0 bg-black/40"></div>
-      <div class="relative z-10 w-full mx-auto h-full px-20 flex items-center">
+      <div
+        class="relative z-10 w-full mx-auto h-full px-20 flex items-center mt-5"
+      >
         <div class="text-white max-w-4xl">
           <h1 class="text-2xl md:text-4xl font-bold leading-tight">
             山东科瑞石油技术门户网站 · DeepOil 智慧经营平台
@@ -25,11 +29,11 @@
           </p>
           <div class="mt-4 md:mt-6 flex gap-3">
             <a
-              class="bg-[#0644a1] hover:bg-[#0a53c1] text-white px-4 py-2 rounded-md cursor-pointer"
+              class="bg-[#0644a1] hover:bg-[#0a53c1] text-white px-4 py-2 cursor-pointer"
               >了解平台</a
             >
             <a
-              class="bg-white/10 hover:bg-white/20 text-white px-4 py-2 rounded-md cursor-pointer"
+              class="bg-white/10 hover:bg-white/20 text-white px-4 py-2 cursor-pointer"
               >联系我们</a
             >
           </div>
@@ -89,18 +93,18 @@ const cards: Card[] = [
     id: "management",
     bg: img1,
     items: [
-      { label: "OA办公系统" },
+      { label: "办公系统(OA)" },
       { label: "客户管理(CRM)" },
       { label: "人力资源(EHR)" },
       { label: "供应链管理(SCM)" },
-      { label: "财务管理(收入、成本、应收账款)" },
-      { label: "经营驾驶舱", tag: "新" },
-      { label: "战略解码与执行" },
+      { label: "财务管理(FM)" },
+      { label: "经营驾驶舱(OC)", tag: "新" },
+      { label: "战略解码与执行(SDM)" },
 
-      { label: "技术研发管理" },
+      { label: "技术研发管理(RD)" },
 
-      { label: "组织资产管理" },
-      { label: "风控、合规管理" },
+      { label: "组织资产管理(AM)" },
+      { label: "风控、合规管理(ECM)" },
     ],
   },
   {
@@ -111,12 +115,12 @@ const cards: Card[] = [
     bg: img2,
     items: [
       { label: "设备管理系统 (PMS)" },
-      { label: "中航北斗智慧管理系统" },
-      { label: "智能连油系统" },
-      { label: "QHSE (安全监控、应急指挥)" },
-      { label: "智能钻井系统", tag: "热" },
-      { label: "智能压裂系统" },
-      { label: "智能注气系统" },
+      { label: "中航北斗(ZH)" },
+      { label: "智能连油系统(ICOTS)" },
+      { label: "安全应急(QHSE)" },
+      { label: "智能钻井系统(IDS)", tag: "热" },
+      { label: "智能压裂系统(IFS)" },
+      { label: "智能注气系统(IGIS)" },
 
       { label: "项目管理 (PM)" },
     ],
@@ -128,10 +132,10 @@ const cards: Card[] = [
     id: "chatbi",
     bg: img3,
     items: [
-      { label: "全局数据治理 (数据中台)", tag: "热" },
-      { label: "智能决策" },
-      { label: "行业AI大模型", tag: "新" },
-      { label: "AI智能体 (智能交互)", tag: "新" },
+      { label: "全局数据治理(DG)", tag: "热" },
+      { label: "智能决策(DI)" },
+      { label: "行业AI大模型(LM)", tag: "新" },
+      { label: "AI智能体(Agent)", tag: "新" },
     ],
   },
 ];

+ 11 - 14
src/views/login.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="min-h-screen relative flex items-center justify-center">
+  <div class="min-h-screen relative flex items-center justify-center font-sans">
     <img
       :src="bgImage"
       alt="background"
@@ -18,10 +18,10 @@
 
     <div class="relative z-10 w-full max-w-[420px] px-6">
       <div class="bg-white/95 backdrop-blur-sm rounded-lg p-8 shadow-2xl">
-        <h1 class="text-2xl font-bold text-center mb-8">登录</h1>
+        <h1 class="text-2xl font-bold text-center">登录</h1>
 
         <!-- 用户名密码登陆 -->
-        <div v-if="!showQrDialog && !showQrOnly">
+        <!-- <div>
           <el-form
             :model="form"
             :rules="rules"
@@ -62,17 +62,11 @@
               >
             </div>
           </div>
-        </div>
+        </div> -->
 
         <!-- 钉钉登陆 -->
-        <div v-show="showQrOnly" class="text-center">
+        <div class="text-center">
           <div id="login_container" class="pb-2"></div>
-
-          <div class="flex gap-3 justify-center mt-4">
-            <el-button class="w-full" @click="backToPasswordLogin"
-              >返回用户名密码登录</el-button
-            >
-          </div>
         </div>
       </div>
     </div>
@@ -80,13 +74,12 @@
 </template>
 
 <script lang="ts" setup>
-import { nextTick, reactive, ref } from "vue";
+import { nextTick, onMounted, reactive, ref } from "vue";
 import { ElMessage } from "element-plus";
 import logo from "@/assets/images/logo.png";
 import bgImage from "@/assets/images/bg.png";
 import { login } from "@/api/user";
 import * as authUtil from "@/utils/auth";
-import { encrypt } from "@/utils/jsencrypt";
 
 type LoginForm = {
   username: string;
@@ -184,7 +177,7 @@ const initDingLogin = () => {
       "&state=" +
       state +
       "&redirect_uri=" +
-      import.meta.env.VITE_DINGTALK_REDIRECT_URI
+      import.meta.env.VITE_DINGTALK_REDIRECT_URI,
   );
 
   nextTick(() => {
@@ -227,6 +220,10 @@ const backToPasswordLogin = () => {
   // 移除监听事件
   window.removeEventListener("message", handleMsg());
 };
+
+onMounted(() => {
+  qrLogin();
+});
 </script>
 
 <style scoped>