| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412 |
- <template>
- <div class="drive-page">
- <Header />
- <main class="drive-main">
- <section class="drive-hero">
- <div class="drive-hero__copy">
- <p class="drive-hero__eyebrow">DASHBOARD PORTAL</p>
- <p class="drive-hero__title">驾驶舱门户</p>
- <p class="drive-hero__desc">选择一个驾驶舱,快速进入对应业务看板。</p>
- </div>
- <div class="drive-hero__visual">
- <el-image :src="banner" class="drive-hero__image" />
- </div>
- </section>
- <section class="drive-tabs px-10">
- <button type="button" class="drive-tab drive-tab--active">
- 全部驾驶舱
- </button>
- <button type="button" class="drive-tab">经营管理</button>
- <button type="button" class="drive-tab">生产运营</button>
- <button type="button" class="drive-tab">财务管理</button>
- <button type="button" class="drive-tab">供应链管理</button>
- <button type="button" class="drive-tab">市场营销</button>
- <button type="button" class="drive-tab">QHSE</button>
- </section>
- <section class="drive-grid md:px-20">
- <button
- v-for="card in driveCards"
- :key="card.title"
- type="button"
- class="drive-card overflow-hidden"
- :style="{
- '--bg-image': `url(${card.pcBg})`,
- '--mobile-bg-image': `url(${card.mobileBg})`,
- }"
- @click="openDrive(card)"
- ></button>
- </section>
- </main>
- <div class="mt-[500px] md:mt-[300px]">
- <Footer />
- </div>
- </div>
- </template>
- <script setup lang="ts">
- import Header from "@components/home/header.vue";
- import Footer from "@components/home/Footer.vue";
- import { Icon } from "@iconify/vue";
- import { getMCSsoToken } from "@/api/user";
- import { useUserStore } from "@/stores/useUserStore";
- import { getAccessToken } from "@/utils/auth";
- import banner from "@/assets/images/drivebannere.png";
- import drivePc1 from "@/assets/images/dr1.png"; // 经营驾驶舱pc端背景图
- import drivePc2 from "@/assets/images/生产pc.png"; // 生产驾驶舱pc端背景图
- import drivePc3 from "@/assets/images/财务pc.png"; // 财务驾驶舱pc端背景图
- import drivePc4 from "@/assets/images/供应链pc.png"; // 供应链驾驶舱pc端背景图
- import drivePc5 from "@/assets/images/市场pc.png"; // 市场驾驶舱pc端背景图
- import drivePc6 from "@/assets/images/qhsepc.png"; // QHSE驾驶舱pc端背景图
- import driveMobile1 from "@/assets/images/mobile.png"; // 经营驾驶舱移动端背景图
- import driveMobile2 from "@/assets/images/生产驾驶舱.png"; // 生产驾驶舱移动端背景图
- import driveMobile3 from "@/assets/images/财务驾驶舱.png"; // 财务驾驶舱移动端背景图
- import driveMobile4 from "@/assets/images/供应链驾驶舱.png"; // 供应链驾驶舱移动端背景图
- import driveMobile5 from "@/assets/images/市场驾驶舱.png"; // 市场驾驶舱移动端背景图
- import driveMobile6 from "@/assets/images/QHSE驾驶舱.png"; // QHSE驾驶舱移动端背景图
- const userStore = useUserStore();
- type DriveCard = {
- title: string;
- description: string;
- url: string;
- bgColor: string;
- pcBg: string;
- mobileBg: string;
- };
- const driveCards: DriveCard[] = [
- {
- title: "经营驾驶舱",
- description: "查看经营分析、经营指标与执行情况。",
- url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/9fb42908-894a-4373-a6be-ce046a42851d?preview=true&page_number=1",
- bgColor: "#3876e0",
- pcBg: drivePc1,
- mobileBg: driveMobile1,
- },
- {
- title: "生产驾驶舱",
- description: "查看生产运营态势、核心指标与执行情况。",
- url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/dbc9cf73-81ce-43f1-9923-45cdfa5d5d3a?preview=true&page_number=1",
- bgColor: "#0f766e",
- pcBg: drivePc2,
- mobileBg: driveMobile2,
- },
- {
- title: "财务驾驶舱",
- description: "查看财务分析、预算执行与经营数据表现。",
- url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/e836fb5b-092c-4d64-a324-3beeb4fac0cc?preview=true&page_number=1",
- bgColor: "#ca8a04",
- pcBg: drivePc3,
- mobileBg: driveMobile3,
- },
- {
- title: "供应链驾驶舱",
- description: "查看供应链分析、物料需求与执行。",
- url: "#",
- bgColor: "#7c3aed",
- pcBg: drivePc4,
- mobileBg: driveMobile4,
- },
- {
- title: "市场驾驶舱",
- description: "查看市场分析、销售数据与执行情况。",
- url: "#",
- bgColor: "#16a34a",
- pcBg: drivePc5,
- mobileBg: driveMobile5,
- },
- {
- title: "QHSE驾驶舱",
- description: "查看安全、健康、环境与质量数据。",
- url: "#",
- bgColor: "#dc2626",
- pcBg: drivePc6,
- mobileBg: driveMobile6,
- },
- ];
- const openDrive = async (option: DriveCard) => {
- if (userStore.getUser.username && getAccessToken()) {
- const res = await getMCSsoToken();
- if (res) {
- window.open(`${option.url}&ssoToken=${res}`, "_blank");
- }
- }
- };
- </script>
- <style scoped>
- .drive-page {
- min-height: 100vh;
- background:
- radial-gradient(circle at 50% 0%, rgba(30, 74, 255, 0.18), transparent 28%),
- radial-gradient(
- circle at 82% 18%,
- rgba(151, 66, 255, 0.16),
- transparent 18%
- ),
- linear-gradient(180deg, #000613 0%, #000613 100%);
- }
- .drive-main {
- max-width: 100vw;
- margin: 0 auto;
- padding-top: 50px;
- }
- .drive-hero {
- position: relative;
- min-height: 340px;
- overflow: hidden;
- background:
- linear-gradient(180deg, rgba(2, 8, 25, 0.55), rgba(2, 8, 25, 0.86)), #000613;
- box-shadow:
- 0 24px 60px rgba(0, 0, 0, 0.42),
- inset 0 1px 0 rgba(255, 255, 255, 0.04);
- }
- .drive-hero::before {
- content: "";
- position: absolute;
- inset: 0;
- background: linear-gradient(
- 90deg,
- rgba(0, 6, 19, 0.8) 0%,
- rgba(0, 6, 19, 0.24) 40%,
- rgba(0, 6, 19, 0.08) 100%
- );
- z-index: 1;
- }
- .drive-hero__copy {
- position: absolute;
- z-index: 2;
- left: 56px;
- top: 54px;
- max-width: 560px;
- }
- .drive-hero__eyebrow {
- margin: 0 0 16px;
- color: #6d77ff;
- font-size: 14px;
- font-weight: 700;
- letter-spacing: 0.22em;
- }
- .drive-hero__title {
- margin: 0;
- color: #f5f8ff;
- font-size: clamp(20px, 5vw, 50px);
- font-weight: 900;
- line-height: 1.08;
- text-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
- }
- .drive-hero__desc {
- margin: 20px 0 0;
- color: #5c6dc8;
- font-size: 18px;
- line-height: 1.8;
- }
- .drive-hero__visual {
- position: absolute;
- inset: 0;
- }
- .drive-hero__image {
- width: 100%;
- height: 100%;
- }
- .drive-hero__image :deep(img) {
- width: 100%;
- height: 100%;
- object-fit: cover;
- filter: saturate(1.1) contrast(1.05);
- }
- .drive-tabs {
- display: grid;
- grid-template-columns: repeat(7, minmax(0, 1fr));
- gap: 0;
- margin: 0 auto;
- padding: 12px 18px;
- width: 90%;
- border: 1px solid rgba(79, 110, 208, 0.16);
- border-radius: 10px;
- background: #070e24;
- box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
- }
- .drive-tab {
- height: 58px;
- border: 0;
- border-right: 1px solid rgba(255, 255, 255, 0.06);
- background: transparent;
- color: rgba(220, 229, 255, 0.78);
- font-size: 18px;
- font-weight: 700;
- cursor: pointer;
- }
- .drive-tab:last-child {
- border-right: 0;
- }
- .drive-tab--active {
- color: #fff;
- position: relative;
- }
- .drive-tab--active::after {
- content: "";
- position: absolute;
- left: 50%;
- bottom: -12px;
- width: 72px;
- height: 4px;
- border-radius: 999px;
- transform: translateX(-50%);
- background: linear-gradient(90deg, #8f65ff 0%, #4d82ff 100%);
- box-shadow: 0 0 18px rgba(97, 111, 255, 0.85);
- }
- .drive-grid {
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 22px;
- margin-top: 30px;
- }
- .drive-card {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 184px;
- /* 使用 CSS 变量动态绑定背景图 */
- background-image: var(--bg-image);
- background-size: contain;
- background-position: center;
- background-repeat: no-repeat;
- text-align: center;
- cursor: pointer;
- transition:
- transform 0.2s ease,
- box-shadow 0.2s ease,
- border-color 0.2s ease;
- overflow: hidden;
- margin-top: -50px;
- }
- .drive-card:hover {
- transform: translateY(-4px);
- border-color: rgba(115, 145, 255, 0.42);
- box-shadow: 0 28px 54px rgba(0, 0, 0, 0.42);
- }
- /* 补充缺失的内容样式,确保文字能显示在背景图上 */
- .drive-card__content {
- position: relative;
- z-index: 1;
- min-width: 0;
- flex: 1;
- /* 根据原设计可能需要调整文字颜色或背景遮罩以确保可读性 */
- }
- .drive-card__title {
- margin: 0;
- color: #f4f7ff;
- font-size: 28px;
- font-weight: 700;
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
- }
- .drive-card__text {
- margin: 10px 0 0;
- color: rgba(191, 203, 235, 0.82);
- font-size: 16px;
- line-height: 1.7;
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
- }
- .drive-card__arrow {
- position: relative;
- z-index: 1;
- color: rgba(210, 220, 248, 0.82);
- font-size: 34px;
- flex-shrink: 0;
- transition:
- transform 0.2s ease,
- color 0.2s ease;
- }
- .drive-card:hover .drive-card__arrow {
- color: #ffffff;
- transform: translate(2px, -2px);
- }
- @media (max-width: 768px) {
- .drive-main {
- padding: 50px 0px 56px;
- margin-top: 0;
- }
- .drive-hero {
- min-height: 260px;
- }
- .drive-hero__copy {
- left: 20px;
- right: 20px;
- top: 24px;
- }
- .drive-tabs {
- grid-template-columns: repeat(2, minmax(0, 1fr));
- }
- .drive-grid {
- grid-template-columns: 1fr;
- gap: 16px;
- padding-left: 0;
- }
- .drive-card {
- min-height: 100px;
- height: 100px; /* 修正原代码中 height: 0px 的问题,确保卡片有高度 */
- width: 100%; /* 修正原代码中 width: 100vw 可能导致溢出问题,通常用 100% */
- padding: 0;
- margin-top: 0;
- /* 使用 CSS 变量动态绑定移动端背景图 */
- background-image: var(--mobile-bg-image);
- background-size: contain;
- background-position: center center;
- }
- .drive-card__title {
- font-size: 20px;
- }
- .drive-hero__image :deep(img) {
- object-fit: cover;
- object-position: 68% center;
- }
- }
- </style>
|