Kaynağa Gözat

fix: bug修复及三方页面优化

wzyyy 3 yıl önce
ebeveyn
işleme
b0cc4961ba

+ 1 - 1
config/routes.ts

@@ -25,7 +25,7 @@
           {
             name: 'bind',
             path: '/account/center/bind',
-            component: './account/Center/bind',
+            component: './account/Center/Bind',
           },
         ],
       },

BIN
public/images/bind/Rectangle.png


BIN
public/images/bind/Vector.png


BIN
public/images/bind/bindPage.png


BIN
public/images/bind/jetlinksLogo.png


+ 55 - 8
src/pages/account/Center/bind/index.less

@@ -1,12 +1,59 @@
-.col {
-  display: flex;
-  justify-content: center;
+.cards {
+  position: absolute;
+  top: 150px;
+  left: 17%;
+  box-sizing: border-box;
+  width: 66%;
+  background: #fff;
+  border: 1px solid #e0e4e8;
+  border-radius: 2px;
 
-  .item {
+  .title {
+    margin: 50px 0;
+    color: #0f1222;
+    font-weight: 400;
+    font-size: 24px;
+    font-family: 'PingFang SC';
+    font-style: normal;
+    line-height: 25px;
+    text-align: center;
+  }
+
+  .info {
+    display: flex;
+    justify-content: center;
+
+    .infotitle {
+      width: 64px;
+      height: 24px;
+      margin-left: 10px;
+      color: rgba(0, 0, 0, 0.85);
+      font-weight: 400;
+      font-size: 16px;
+      font-family: 'PingFang SC';
+      font-style: normal;
+      line-height: 24px;
+    }
+
+    .item {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      width: 300px;
+
+      .fonts {
+        font-weight: 400;
+        font-size: 16px;
+        font-family: 'PingFang SC';
+        font-style: normal;
+        line-height: 16px;
+        opacity: 0.75;
+        mix-blend-mode: normal;
+      }
+    }
+  }
+  .btn {
     display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: space-around;
-    width: 300px;
+    justify-content: center;
   }
 }

+ 74 - 49
src/pages/account/Center/bind/index.tsx

@@ -1,4 +1,4 @@
-import { Avatar, Button, Card, Col, message, Row } from 'antd';
+import { Button, Card, message } from 'antd';
 import { useEffect, useState } from 'react';
 import Service from '@/pages/account/Center/service';
 import styles from './index.less';
@@ -10,14 +10,15 @@ const Bind = () => {
   const [user, setUser] = useState<any>();
   const [code, setCode] = useState<string>('');
 
+  const bindPage = require('/public/images/bind/bindPage.png');
+  const Vector = require('/public/images/bind/Vector.png');
+  const Rectangle = require('/public/images/bind/Rectangle.png');
+  const logo = require('/public/images/bind/jetlinksLogo.png');
+
   const iconMap = new Map();
   iconMap.set('dingtalk', require('/public/images/notice/dingtalk.png'));
   iconMap.set('wechat-webapp', require('/public/images/notice/wechat.png'));
 
-  const bGroundMap = new Map();
-  bGroundMap.set('dingtalk', require('/public/images/notice/dingtalk-background.png'));
-  bGroundMap.set('wechat-webapp', require('/public/images/notice/wechat-background.png'));
-
   const bindUserInfo = (params: string) => {
     service.bindUserInfo(params).then((res) => {
       if (res.status === 200) {
@@ -40,55 +41,79 @@ const Bind = () => {
   }, []);
   return (
     <>
-      <Card>
-        <div style={{ margin: '0 auto', width: 800 }}>
-          <Row>
-            <Col span={12} className={styles.col}>
-              <Card title="个人信息">
-                <div className={styles.item}>
-                  <div style={{ height: 100 }}>
-                    <Avatar size={90} src={user?.avatar} />
+      <div
+        style={{
+          width: '100%',
+          height: '100%',
+          background: `url(${bindPage}) no-repeat`,
+          backgroundSize: '100% 100%',
+        }}
+      >
+        <div className={styles.cards}>
+          <div className={styles.title}>第三方账户绑定</div>
+          <div className={styles.info}>
+            <Card
+              title={
+                <div style={{ display: 'flex', alignItems: 'center' }}>
+                  <div>
+                    <img src={Rectangle} />
                   </div>
-                  <p>登录账号:{user?.username}</p>
-                  <p>姓名:{user?.name}</p>
+                  <div className={styles.infotitle}>个人信息</div>
                 </div>
-              </Card>
-            </Col>
-            <Col span={12} className={styles.col}>
-              <Card title="三方账号信息">
-                <div className={styles.item}>
-                  <div style={{ height: 100 }}>
-                    <img style={{ height: 80 }} src={iconMap.get(bindUser?.type)} />
+              }
+            >
+              <div className={styles.item}>
+                <div style={{ height: 100, marginTop: 10, marginBottom: 10 }}>
+                  <img src={logo} style={{ width: 90, height: 90 }} />
+                </div>
+                <p className={styles.fonts}>账号:{user?.username}</p>
+                <p className={styles.fonts}>用户名:{user?.name}</p>
+              </div>
+            </Card>
+            <div style={{ position: 'relative', top: '135px', margin: '0 20px' }}>
+              <img src={Vector} />
+            </div>
+            <Card
+              title={
+                <div style={{ display: 'flex', alignItems: 'center' }}>
+                  <div>
+                    <img src={Rectangle} />
                   </div>
-                  <p>组织:{bindUser?.providerName}</p>
-                  <p>名字:{bindUser?.result.others.name}</p>
+                  <div className={styles.infotitle}>三方账户信息</div>
+                </div>
+              }
+            >
+              <div className={styles.item}>
+                <div style={{ height: 100, marginTop: 10, marginBottom: 10 }}>
+                  <img style={{ height: 80 }} src={iconMap.get(bindUser?.type)} />
                 </div>
-              </Card>
-            </Col>
-          </Row>
-          <Row>
-            <Col span={24} style={{ textAlign: 'center', marginTop: 20 }}>
-              <Button
-                type="primary"
-                onClick={() => {
-                  // window.close()
-                  service.bind(code).then((res) => {
-                    if (res.status === 200) {
-                      message.success('绑定成功');
-                      localStorage.setItem('onBind', 'true');
-                      setTimeout(() => window.close(), 300);
-                    } else {
-                      message.error('绑定失败');
-                    }
-                  });
-                }}
-              >
-                立即绑定
-              </Button>
-            </Col>
-          </Row>
+                <p className={styles.fonts}>账户:{bindUser?.providerName}</p>
+                <p className={styles.fonts}>用户名:{bindUser?.result.others.name}</p>
+              </div>
+            </Card>
+          </div>
+          <div className={styles.btn}>
+            <Button
+              style={{ marginTop: 30, marginBottom: 30 }}
+              type="primary"
+              onClick={() => {
+                // window.close()
+                service.bind(code).then((res) => {
+                  if (res.status === 200) {
+                    message.success('绑定成功');
+                    localStorage.setItem('onBind', 'true');
+                    setTimeout(() => window.close(), 1000);
+                  } else {
+                    message.error('绑定失败');
+                  }
+                });
+              }}
+            >
+              立即绑定
+            </Button>
+          </div>
         </div>
-      </Card>
+      </div>
     </>
   );
 };

+ 1 - 0
src/pages/link/Channel/Modbus/Access/addPoint/index.tsx

@@ -57,6 +57,7 @@ const AddPoint = (props: Props) => {
         initialValues={{
           ...props.data,
           codecConfig: {
+            ...props.data?.codecConfig,
             readIndex: props.data?.codecConfig?.readIndex || 0,
             scaleFactor: props.data?.codecConfig?.scaleFactor || 1,
           },

+ 2 - 2
src/pages/link/Channel/Modbus/index.tsx

@@ -93,12 +93,12 @@ const Modbus = () => {
             onConfirm: async () => {
               if (record.state.value === 'disabled') {
                 await service.edit({
-                  id: record.id,
+                  ...record,
                   state: 'enabled',
                 });
               } else {
                 await service.edit({
-                  id: record.id,
+                  ...record,
                   state: 'disabled',
                 });
               }

+ 1 - 1
src/pages/link/Channel/Opcua/index.tsx

@@ -136,7 +136,7 @@ const Opcua = () => {
           disabled={record.state.value === 'enabled'}
           popConfirm={{
             title: '确认删除',
-            disabled: record.state.value === 'enable',
+            disabled: record.state.value === 'enabled',
             onConfirm: async () => {
               const resp: any = await service.remove(record.id);
               if (resp.status === 200) {

+ 0 - 12
src/utils/menu/index.ts

@@ -85,12 +85,6 @@ export const extraRouteArr = [
         url: '/account/center',
       },
       {
-        code: 'account/Center/bind',
-        name: '第三方页面',
-        url: '/account/center/bind',
-        hideInMenu: true,
-      },
-      {
         code: 'account/NotificationSubscription',
         name: '通知订阅',
         url: '/account/NotificationSubscription',
@@ -100,12 +94,6 @@ export const extraRouteArr = [
         name: '通知记录',
         url: '/account/NotificationRecord',
       },
-      // {
-      //   code: 'account/Center/bind',
-      //   name: '第三方页面',
-      //   url: '/account/center/bind',
-      //   hideInMenu: true,
-      // },
     ],
   },
 ];