Jelajahi Sumber

添加scada功能入口

Renxy 1 tahun lalu
induk
melakukan
2f821cd45a

+ 7 - 40
.umirc.ts

@@ -143,46 +143,6 @@ export default defineConfig({
       component: './ContractManager/index',
       icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/contractIcon.png',
     },
-    // {
-    //   name: '授权管理',
-    //   path: '/permission',
-    //   routes: [
-    //     {
-    //       name: '菜单授权',
-    //       path: '/permission/menu',
-    //       component: './Permission/menu',
-    //     },
-    //     {
-    //       name: '文档管理',
-    //       path: '/permission/file',
-    //       component: './Permission/file',
-    //     },
-    //   ],
-    // },
-    // {
-    //   name: '个人中心',
-    //   path: '/profile',
-    //   icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/profileIcon.png',
-    //   routes: [
-    //     {
-    //       name: '我的申请',
-    //       path: '/profile/apply',
-    //       component: './Profile/apply',
-    //     },
-    //     {
-    //       name: '我的审批',
-    //       path: '/profile/approve',
-    //       component: './Profile/approve',
-    //     },
-    //     {
-    //       name: '已审核',
-    //       path: '/profile/approved',
-    //       component: './Profile/approved',
-    //     },
-    //   ],
-    //   // component: './Profile/index',
-    //   // hideInMenu: true,
-    // },
     {
       name: '个人中心',
       path: '/profile',
@@ -217,6 +177,7 @@ export default defineConfig({
       name: 'CAD实例',
       path: '/cad',
       component: './Cad',
+      hideInMenu: true,
       icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-07-31/3f72fccf-4f9c-4891-a6ec-f04fe4b1d9a2.png',
     },
     {
@@ -225,6 +186,12 @@ export default defineConfig({
       component: './Cad/detail',
       hideInMenu: true,
     },
+    {
+      name: 'Scada功能',
+      path: '/scada',
+      component: './Scada',
+      icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-11-24/27866151-5691-487d-8c58-5b4ae995395e.png',
+    },
   ],
   npmClient: 'yarn',
 });

TEMPAT SAMPAH
src/assets/UnityMenu/scada.png


+ 12 - 3
src/pages/Home/index.js

@@ -95,14 +95,23 @@ function HomePage(props) {
       },
       Icon: require('@/assets/UnityMenu/userCenter.png'),
     },
+    // {
+    //   id: 10,
+    //   name: 'cad管理',
+    //   active: true,
+    //   click: () => {
+    //     navigate('/cad');
+    //   },
+    //   Icon: require('@/assets/UnityMenu/cad.png'),
+    // },
     {
       id: 10,
-      name: 'cad管理',
+      name: 'Scada功能',
       active: true,
       click: () => {
-        navigate('/cad');
+        navigate('/scada');
       },
-      Icon: require('@/assets/UnityMenu/cad.png'),
+      Icon: require('@/assets/UnityMenu/scada.png'),
     },
   ];
   return (

+ 1 - 3
src/pages/Home/index.less

@@ -35,7 +35,6 @@
 
 .menuContent {
   height: 100%;
-  width: 1486px;
   max-height: 100vh;
   overflow-y: hidden;
   padding-top: 160px;
@@ -71,9 +70,8 @@
   align-items: center;
   width: 130px;
   height: 186px;
-  margin-bottom: 78px;
   user-select: none;
-  margin-left: 120px;
+  margin: 0 60px 78px;
 }
 
 .pic {

+ 31 - 0
src/pages/Scada/index.js

@@ -0,0 +1,31 @@
+import { useRequest, useModel } from '@umijs/max';
+import { getScadaPage, queryV2Projects } from '../../services/scada';
+import { Table } from 'antd';
+import { getToken } from '@/utils/utils';
+const Scada = () => {
+  const token = getToken();
+  const { data, loading } = useRequest(queryV2Projects);
+
+  const handleClick = (id) => {
+    let domain = location.host.includes('work.greentech.com.cn')
+      ? 'https://120.55.44.4:8900/'
+      : 'http://47.96.12.136:8788/';
+    const url = `${domain}smart-water/scada/index.html#/page/3d/${id}?JWT-TOKEN=${token}`;
+    window.open(url);
+  };
+
+  const columns = [
+    {
+      title: '姓名',
+      key: 'Name',
+      render: (record) => <div>{`${record.Name}(${record.Code})`}</div>,
+    },
+
+    {
+      title: '操作',
+      render: (record) => <a onClick={() => handleClick(record.ID)}>跳转</a>,
+    },
+  ];
+  return <Table dataSource={data?.list} columns={columns} loading={loading} />;
+};
+export default Scada;

+ 0 - 0
src/pages/Scada/index.less


+ 13 - 0
src/services/scada.js

@@ -0,0 +1,13 @@
+import { request } from 'umi';
+/**
+ * 带权限的项目列表
+ * @param
+ * @returns
+ */
+export const queryV2Projects = async () => {
+  return await request('/api/v2/project');
+};
+export async function getScadaPage(params = {}) {
+  const res = await request(`/api/v1/scada/page?${stringify(params)}`);
+  return res?.data;
+}