yanghao 2 днів тому
батько
коміт
031e2a1aad
6 змінених файлів з 73 додано та 50 видалено
  1. 1 0
      package.json
  2. 24 0
      pnpm-lock.yaml
  3. 4 0
      src/assets/style/main.css
  4. 3 3
      src/views/drive/index.vue
  5. 13 20
      src/views/flow/index.vue
  6. 28 27
      src/views/index.vue

+ 1 - 0
package.json

@@ -34,6 +34,7 @@
     "vue": "^3.5.22",
     "vue-router": "^4.6.3",
     "vue-types": "^6.0.0",
+    "vue3-count-to": "^1.1.2",
     "web-storage-cache": "^1.1.1"
   },
   "devDependencies": {

+ 24 - 0
pnpm-lock.yaml

@@ -56,6 +56,9 @@ importers:
       vue-types:
         specifier: ^6.0.0
         version: 6.0.0(vue@3.5.22(typescript@5.9.3))
+      vue3-count-to:
+        specifier: ^1.1.2
+        version: 1.1.2(vue@3.5.22(typescript@5.9.3))
       web-storage-cache:
         specifier: ^1.1.1
         version: 1.1.1
@@ -890,6 +893,9 @@ packages:
     resolution: {integrity: sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA==}
     engines: {node: '>=18'}
 
+  core-js@3.49.0:
+    resolution: {integrity: sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==}
+
   cross-spawn@7.0.6:
     resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
     engines: {node: '>= 8'}
@@ -1621,6 +1627,9 @@ packages:
   vscode-uri@3.1.0:
     resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==}
 
+  vue-count-to@1.0.13:
+    resolution: {integrity: sha512-6R4OVBVNtQTlcbXu6SJ8ENR35M2/CdWt3Jmv57jOUM+1ojiFmjVGvZPH8DfHpMDSA+ITs+EW5V6qthADxeyYOQ==}
+
   vue-demi@0.14.10:
     resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==}
     engines: {node: '>=12'}
@@ -1652,6 +1661,11 @@ packages:
       vue:
         optional: true
 
+  vue3-count-to@1.1.2:
+    resolution: {integrity: sha512-C5AvlcGfyM4XvFqPDkni94rqGd5K/+RB+B4xv/1NQx3RrdC+GvXPFzeXW5hWL/jh8ehWLm4LITyK0eMKf4iJbg==}
+    peerDependencies:
+      vue: '>= 3 < 4'
+
   vue@3.5.22:
     resolution: {integrity: sha512-toaZjQ3a/G/mYaLSbV+QsQhIdMo9x5rrqIpYRObsJ6T/J+RyCSFwN2LHNVH9v8uIcljDNa3QzPVdv3Y6b9hAJQ==}
     peerDependencies:
@@ -2444,6 +2458,8 @@ snapshots:
     dependencies:
       is-what: 5.5.0
 
+  core-js@3.49.0: {}
+
   cross-spawn@7.0.6:
     dependencies:
       path-key: 3.1.1
@@ -3135,6 +3151,8 @@ snapshots:
 
   vscode-uri@3.1.0: {}
 
+  vue-count-to@1.0.13: {}
+
   vue-demi@0.14.10(vue@3.5.22(typescript@5.9.3)):
     dependencies:
       vue: 3.5.22(typescript@5.9.3)
@@ -3154,6 +3172,12 @@ snapshots:
     optionalDependencies:
       vue: 3.5.22(typescript@5.9.3)
 
+  vue3-count-to@1.1.2(vue@3.5.22(typescript@5.9.3)):
+    dependencies:
+      core-js: 3.49.0
+      vue: 3.5.22(typescript@5.9.3)
+      vue-count-to: 1.0.13
+
   vue@3.5.22(typescript@5.9.3):
     dependencies:
       '@vue/compiler-dom': 3.5.22

+ 4 - 0
src/assets/style/main.css

@@ -12,6 +12,8 @@
   --bg-tab:#e4e7ed;
   --bg-flow-card:#9ecdf2;
   --color-skeleton: #cfd2f4;
+   --dropdown-menu:#fff;
+    --dropdown-menu-hover:#f5f7fa;
   --bg-flow-tab: transparent;
   --bg-flow-item: #5e98f8;
   --bg-drive-tab:linear-gradient(
@@ -87,6 +89,8 @@
   --bg-table:#091126;
   --bg-table-head:#091126;
   --color-skeleton:#0a193d;
+  --dropdown-menu:#0a193d;
+   --dropdown-menu-hover:#182342;
   --bg-tab:#070e24;
   --tab-text: rgba(220, 229, 255, 0.78);
   --text-primary: #eaf1ff;

+ 3 - 3
src/views/drive/index.vue

@@ -184,7 +184,7 @@ watch(
         {
           title: "QHSE驾驶舱",
           description: "查看安全、健康、环境与质量数据。",
-          url: "#",
+          url: `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=qhse`,
           bgColor: "#dc2626",
           pcBg: drivePc6_white,
           mobileBg: driveMobile6_white,
@@ -241,7 +241,7 @@ watch(
         {
           title: "QHSE驾驶舱",
           description: "查看安全、健康、环境与质量数据。",
-          url: "#",
+          url: `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=qhse`,
           bgColor: "#dc2626",
           pcBg: drivePc6,
           mobileBg: driveMobile6,
@@ -301,7 +301,7 @@ const driveCards = ref([
   {
     title: "QHSE驾驶舱",
     description: "查看安全、健康、环境与质量数据。",
-    url: "#",
+    url: `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=qhse`,
     bgColor: "#dc2626",
     pcBg: themeStore.theme === "light" ? drivePc6_white : drivePc6,
     mobileBg: themeStore.theme === "light" ? driveMobile6_white : driveMobile6,

+ 13 - 20
src/views/flow/index.vue

@@ -51,24 +51,13 @@
                 </div>
                 <div class="card-content">
                   <p class="card-title">{{ item.title }}</p>
-                  <el-skeleton
-                    :rows="1"
-                    :animated="true"
-                    :loading="statsLoading"
-                  >
-                    <template #template>
-                      <el-skeleton-item
-                        variant="text"
-                        style="
-                          width: 60%;
-                          height: 32px;
-                          border-radius: 50px;
-                          background: var(--color-skeleton);
-                        "
-                      />
-                    </template>
-                    <p class="card-number">{{ item.number }}</p>
-                  </el-skeleton>
+                  <p class="card-number">
+                    <CountTo
+                      :start-val="0"
+                      :end-val="item.number"
+                      :duration="2000"
+                    />
+                  </p>
                   <p
                     v-if="item.title === '我的待办'"
                     class="text-[#6b6f99] !text-sm"
@@ -212,7 +201,9 @@
       </div>
     </div>
 
-    <Footer />
+    <div class="mt-20">
+      <Footer />
+    </div>
   </div>
 </template>
 
@@ -220,6 +211,7 @@
 import Header from "@components/home/header.vue";
 import Footer from "@components/home/Footer.vue";
 import { computed, ref, onMounted, onBeforeUnmount, nextTick } from "vue";
+import { CountTo } from "vue3-count-to";
 import { Icon } from "@iconify/vue";
 import banner from "@/assets/images/flwoBanner.png";
 import banner_white from "@/assets/images/flwoBanner_white.jpeg";
@@ -805,6 +797,8 @@ onBeforeUnmount(() => {
       transparent 28%
     ),
     linear-gradient(180deg, #eef3f9 0%, #f7faff 46%, #eef3f9 100%);
+  height: 100vh;
+  /* margin-bottom: 200px; */
 }
 
 :global([data-theme="dark"] .ehr-page) {
@@ -946,7 +940,6 @@ onBeforeUnmount(() => {
   background: transparent;
   outline: none;
   font-size: 14px;
-  color: #0f172a;
 }
 
 .search-field::placeholder {

+ 28 - 27
src/views/index.vue

@@ -538,13 +538,13 @@
           </h4>
         </div>
       </template>
-      <span class="text-black">SRM系统尚未正式上线使用</span>
+      <span class="text-black">账号未授权</span>
       <template #footer>
         <div class="dialog-footer">
-          <el-button @click="dialogVisible = false">取消</el-button>
-          <el-button type="primary" color="#063e8d" @click="confirmSrm">
+          <el-button @click="dialogVisible = false">确定</el-button>
+          <!-- <el-button type="primary" color="#063e8d" @click="confirmSrm">
             继续访问
-          </el-button>
+          </el-button> -->
         </div>
       </template>
     </el-dialog>
@@ -686,8 +686,9 @@ const portalSections: PortalSection[] = [
     height: "210px",
     apps: [
       { label: "设备管理(PMS)", image: pmsimage, active: true },
-      { label: "中航北斗", image: zhonghangimage },
       { label: "质量安全管理(QHSE)", image: qhseimage },
+      { label: "中航北斗", image: zhonghangimage },
+
       { label: "智慧连油", image: lianyouimage },
       { label: "智慧注气", image: zhuqiimage },
       { label: "视频中心(VCS)", image: videoimage },
@@ -1063,25 +1064,25 @@ const handlePortalAppClick = async (app: PortalApp) => {
   }
 
   if (app.label === "供应商管理(SRM)") {
-    // ElMessageBox.confirm("即将跳转到供应商管理系统,是否继续?", "提示", {
-    //   confirmButtonText: "继续",
-    //   cancelButtonText: "取消",
-    // }).then(async () => {});
-    dialogVisible.value = true;
-    // if (userStore.getUser.username && getAccessToken()) {
-    //   const res = await srmLogin({
-    //     username: userStore.getUser.username,
-    //   });
-
-    //   if (res) {
-    //     window.open(
-    //       `https://srmqas.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
-    //       "_blank",
-    //     );
-    //   }
-    // } else {
-    //   router.push({ path: "/login" });
-    // }
+    if (userStore.getUser.username && getAccessToken()) {
+      const res = await srmLogin({
+        username: userStore.getUser.username,
+      });
+
+      if (JSON.parse(res).msg === "账号未授权") {
+        dialogVisible.value = true;
+        return;
+      }
+
+      if (res) {
+        window.open(
+          `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
+          "_blank",
+        );
+      }
+    } else {
+      router.push({ path: "/login" });
+    }
   }
 
   if (app.label === "智能钻井") {
@@ -2212,7 +2213,7 @@ onUnmounted(() => {
 }
 /* 下拉菜单主体 */
 :deep(.el-dropdown-menu) {
-  background-color: rgba(0, 0, 0, 0.75) !important;
+  background-color: var(--dropdown-menu) !important;
   border: none !important;
   border-radius: 5px;
   box-shadow: none !important; /* 关键:去除阴影导致的“白边”视觉效果 */
@@ -2221,7 +2222,7 @@ onUnmounted(() => {
 
 /* 菜单项 */
 :deep(.el-dropdown-menu__item) {
-  background: #192a5b !important;
+  background: var(--dropdown-menu) !important;
   color: #fff !important; /* 确保文字颜色可见 */
   padding: 0 !important;
   margin: 0 !important;
@@ -2229,7 +2230,7 @@ onUnmounted(() => {
 }
 
 :deep(.el-dropdown-menu__item):hover {
-  background: #182342 !important;
+  background: var(--dropdown-menu-hover) !important;
   color: #fff !important;
 }
 :deep(.el-dropdown-menu) {