wzyyy 3 лет назад
Родитель
Сommit
4021bf478f

+ 1 - 2
src/app.tsx

@@ -242,7 +242,6 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
       // content: initialState?.currentUser?.name,
     },
     itemRender: (route, _, routes) => {
-      console.log(route);
       const isToParentUrl = getMenuPathByCode('notice');
       const chilck = routes.indexOf(route) !== 0;
       const goto = routes.some((item) => {
@@ -256,7 +255,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
           }
         }
       });
-      return chilck && goto && route.path !== '/iot/rule-engine/Alarm' ? (
+      return chilck && goto && route.path !== '/iot/link/Channel' ? (
         <Link to={route.path}>{route.breadcrumbName}</Link>
       ) : (
         <span>{route.breadcrumbName}</span>

+ 1 - 1
src/pages/account/Center/bind/index.tsx

@@ -45,7 +45,7 @@ const Bind = () => {
       <div className={styles.topimg}>
         <img src={logo} style={{ width: '50px', height: '50px' }} />
         <img src={Vector} style={{ height: '15px', margin: '0 15px' }} />
-        <img src={logo} style={{ width: '50px', height: '50px' }} />
+        <img src={iconMap.get(bindUser?.type)} style={{ width: '50px', height: '50px' }} />
       </div>
       <div className={styles.topfont}>
         你已通过{bindUser?.type === 'dingtalk' ? '钉钉' : '微信'}授权,完善以下登录信息即可以完成绑定

+ 1 - 1
src/pages/account/Center/index.tsx

@@ -103,6 +103,7 @@ const Center = () => {
     service.savePassWord(parms).subscribe((res) => {
       if (res.status === 200) {
         onlyMessage('保存成功');
+        setPassword(false);
       }
     });
   };
@@ -324,7 +325,6 @@ const Center = () => {
         <PasswordEdit
           save={(item: any) => {
             savePassword(item);
-            setPassword(false);
           }}
           visible={password}
           close={() => {

+ 1 - 0
src/pages/device/Category/Save/index.tsx

@@ -123,6 +123,7 @@ const Save = (props: Props) => {
         'x-component': 'NumberPicker',
         'x-component-props': {
           placeholder: '请输入分类排序',
+          min: 1,
         },
         name: 'sortIndex',
       },

+ 1 - 1
src/pages/device/Category/index.tsx

@@ -70,7 +70,7 @@ const Category = observer(() => {
     {
       title: '分类排序',
       dataIndex: 'sortIndex',
-      valueType: 'digit',
+      // valueType: 'digit',
       sorter: true,
       // render: (text) => (
       //   <Space>{text}<EditOutlined onClick={() => {

+ 9 - 1
src/pages/device/Instance/Detail/Config/index.tsx

@@ -71,7 +71,15 @@ const Config = () => {
           </div>
         );
       } else {
-        return <div>{config[item.property] || '--'}</div>;
+        return (
+          <div>
+            <Tooltip title={config[item.property] || '--'} placement="topLeft">
+              <div className="ellipsis" style={{ width: 300 }}>
+                {config[item.property] || '--'}
+              </div>
+            </Tooltip>
+          </div>
+        );
       }
     } else {
       return '--';

+ 14 - 4
src/pages/device/Instance/Detail/Info/index.tsx

@@ -1,4 +1,4 @@
-import { Card, Descriptions } from 'antd';
+import { Card, Descriptions, Tooltip } from 'antd';
 import { InstanceModel } from '@/pages/device/Instance';
 import moment from 'moment';
 import { observer } from '@formily/react';
@@ -47,7 +47,11 @@ const Info = observer(() => {
               defaultMessage: '设备ID',
             })}
           >
-            {InstanceModel.detail?.id}
+            <Tooltip placement="topLeft" title={InstanceModel.detail?.id}>
+              <div className="ellipsis" style={{ width: 300 }}>
+                {InstanceModel.detail?.id}
+              </div>
+            </Tooltip>
           </Descriptions.Item>
           <Descriptions.Item
             label={intl.formatMessage({
@@ -55,7 +59,11 @@ const Info = observer(() => {
               defaultMessage: '产品名称',
             })}
           >
-            {InstanceModel.detail?.productName}
+            <Tooltip placement="topLeft" title={InstanceModel.detail?.productName}>
+              <div className="ellipsis" style={{ width: 300 }}>
+                {InstanceModel.detail?.productName}
+              </div>
+            </Tooltip>
           </Descriptions.Item>
           <Descriptions.Item
             label={intl.formatMessage({
@@ -113,7 +121,9 @@ const Info = observer(() => {
               defaultMessage: '说明',
             })}
           >
-            {InstanceModel.detail?.description}
+            <Tooltip placement="topLeft" title={InstanceModel.detail?.description}>
+              <div className="ellipsis">{InstanceModel.detail?.description}</div>
+            </Tooltip>
           </Descriptions.Item>
         </Descriptions>
         <Config />

+ 8 - 1
src/pages/device/Instance/Detail/Reation/index.tsx

@@ -57,7 +57,14 @@ const Reation = () => {
       >
         {(data || [])?.map((item: any) => (
           <Descriptions.Item span={1} label={item.relationName} key={item.objectId}>
-            {item?.related ? _.map(item?.related || [], 'name').join(',') : '--'}
+            <Tooltip
+              title={item?.related ? _.map(item?.related || [], 'name').join(',') : '--'}
+              placement="topLeft"
+            >
+              <div className="ellipsis" style={{ width: 300 }}>
+                {item?.related ? _.map(item?.related || [], 'name').join(',') : '--'}
+              </div>
+            </Tooltip>
           </Descriptions.Item>
         ))}
       </Descriptions>

+ 6 - 2
src/pages/device/Instance/Detail/Tags/index.tsx

@@ -1,4 +1,4 @@
-import { Button, Descriptions } from 'antd';
+import { Button, Descriptions, Tooltip } from 'antd';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import { InstanceModel } from '@/pages/device/Instance';
 import { useEffect, useState } from 'react';
@@ -45,7 +45,11 @@ const Tags = () => {
       >
         {(tags || [])?.map((item: any) => (
           <Descriptions.Item span={1} label={`${item.name}(${item.key})`} key={item.key}>
-            {item.value || '--'}
+            <Tooltip title={item.value || '--'} placement="topLeft">
+              <div className="ellipsis" style={{ width: 300 }}>
+                {item.value || '--'}{' '}
+              </div>
+            </Tooltip>
           </Descriptions.Item>
         ))}
       </Descriptions>

+ 18 - 5
src/pages/device/Instance/Detail/index.tsx

@@ -267,11 +267,18 @@ const InstanceDetail = observer(() => {
       tabActiveKey={InstanceModel.active}
       content={
         <Descriptions size="small" column={4}>
-          <Descriptions.Item label={'ID'}>{InstanceModel.detail?.id}</Descriptions.Item>
+          <Descriptions.Item label={'ID'}>
+            <Tooltip placement="topLeft" title={InstanceModel.detail?.id}>
+              <div className="ellipsis-70">{InstanceModel.detail?.id}</div>
+            </Tooltip>
+          </Descriptions.Item>
           <Descriptions.Item label={'所属产品'}>
             <PermissionButton
               type={'link'}
               size={'small'}
+              tooltip={{
+                title: InstanceModel.detail?.productName,
+              }}
               isPermission={!!getMenuPathByCode(MENUS_CODE['device/Product'])}
               onClick={() => {
                 const url = getMenuPathByParams(
@@ -283,14 +290,20 @@ const InstanceDetail = observer(() => {
                 }
               }}
             >
-              {InstanceModel.detail?.productName}
+              <div className="ellipsis" style={{ width: 250 }}>
+                {InstanceModel.detail?.productName}
+              </div>
             </PermissionButton>
           </Descriptions.Item>
         </Descriptions>
       }
       title={
-        <>
-          {InstanceModel.detail?.name}
+        <div style={{ display: 'flex', alignItems: 'center' }}>
+          <Tooltip placement="topLeft" title={InstanceModel.detail?.name}>
+            <div className="ellipsis" style={{ width: 250 }}>
+              {InstanceModel.detail?.name}
+            </div>
+          </Tooltip>
           <Divider type="vertical" />
           <Space>
             {deviceStatus.get(InstanceModel.detail?.state?.value)}
@@ -349,7 +362,7 @@ const InstanceDetail = observer(() => {
               </PermissionButton>
             )}
           </Space>
-        </>
+        </div>
       }
       // extra={[
       //   statusMap[0],

+ 17 - 3
src/pages/device/Product/Detail/Access/index.tsx

@@ -393,10 +393,24 @@ const Access = () => {
                     </span>
                   }
                 />
-                <div className={styles.context}>{access?.name}</div>
                 <div className={styles.context}>
-                  {access?.description ||
-                    dataSource.find((item) => item?.id === access?.provider)?.description}
+                  <Tooltip placement="topLeft" title={access?.name}>
+                    <div className="ellipsis-70">{access?.name}</div>
+                  </Tooltip>
+                </div>
+                <div className={styles.context}>
+                  <Tooltip
+                    placement="topLeft"
+                    title={
+                      access?.description ||
+                      dataSource.find((item) => item?.id === access?.provider)?.description
+                    }
+                  >
+                    <div className="ellipsis-70">
+                      {access?.description ||
+                        dataSource.find((item) => item?.id === access?.provider)?.description}
+                    </div>
+                  </Tooltip>
                 </div>
               </div>
 

+ 8 - 2
src/pages/device/Product/Detail/BaseInfo/index.tsx

@@ -1,5 +1,5 @@
 import { productModel, service } from '@/pages/device/Product';
-import { Button, Descriptions } from 'antd';
+import { Button, Descriptions, Tooltip } from 'antd';
 import { useState } from 'react';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import { EditOutlined } from '@ant-design/icons';
@@ -171,7 +171,13 @@ const BaseInfo = (props: BaseInfoProps) => {
         ]}
         bordered
       >
-        <Descriptions.Item label={'ID'}>{productModel.current?.id}</Descriptions.Item>
+        <Descriptions.Item label={'ID'}>
+          <Tooltip placement="topLeft" title={productModel.current?.id}>
+            <div className="ellipsis-70" style={{ width: 300 }}>
+              {productModel.current?.id}
+            </div>
+          </Tooltip>
+        </Descriptions.Item>
         <Descriptions.Item
           label={intl.formatMessage({
             id: 'pages.device.productDetail.classifiedName',

+ 7 - 1
src/pages/device/Product/Detail/index.tsx

@@ -261,7 +261,13 @@ const ProductDetail = observer(() => {
           </Descriptions>
         </Spin>
       }
-      title={productModel.current?.name}
+      title={
+        <Tooltip placement="topLeft" title={productModel.current?.name}>
+          <div className="ellipsis" style={{ width: 250 }}>
+            {productModel.current?.name}
+          </div>
+        </Tooltip>
+      }
       subTitle={
         permission.update ? (
           <Popconfirm

+ 25 - 22
src/pages/device/components/Metadata/Base/Edit/index.tsx

@@ -1,4 +1,4 @@
-import { Button, Drawer, Dropdown, Menu, message } from 'antd';
+import { Button, Drawer, message } from 'antd';
 import { createSchemaField, observer } from '@formily/react';
 import MetadataModel from '../model';
 import type { Field, IFieldState } from '@formily/core';
@@ -1064,13 +1064,13 @@ const Edit = observer((props: Props) => {
     setLoading(false);
   };
 
-  const menu = (
-    <Menu>
-      <Menu.Item key="1" onClick={() => saveMetadata(true)}>
-        保存并生效
-      </Menu.Item>
-    </Menu>
-  );
+  // const menu = (
+  //   <Menu>
+  //     <Menu.Item key="1" onClick={() => saveMetadata(true)}>
+  //       保存并生效
+  //     </Menu.Item>
+  //   </Menu>
+  // );
   return (
     <>
       <Drawer
@@ -1092,20 +1092,23 @@ const Edit = observer((props: Props) => {
         zIndex={1000}
         placement={'right'}
         extra={
-          props.type === 'product' ? (
-            <Dropdown.Button
-              loading={loading}
-              type="primary"
-              onClick={() => saveMetadata()}
-              overlay={menu}
-            >
-              保存数据
-            </Dropdown.Button>
-          ) : (
-            <Button loading={loading} type="primary" onClick={() => saveMetadata()}>
-              保存数据
-            </Button>
-          )
+          <Button loading={loading} type="primary" onClick={() => saveMetadata()}>
+            保存
+          </Button>
+          // props.type === 'product' ? (
+          //   <Dropdown.Button
+          //     loading={loading}
+          //     type="primary"
+          //     onClick={() => saveMetadata()}
+          //     overlay={menu}
+          //   >
+          //     保存
+          //   </Dropdown.Button>
+          // ) : (
+          //   <Button loading={loading} type="primary" onClick={() => saveMetadata()}>
+          //     保存
+          //   </Button>
+          // )
         }
       >
         <Form form={form} layout="vertical" size="small">

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

@@ -267,7 +267,7 @@ const AddPoint = (props: Props) => {
         <Row gutter={[24, 24]}>
           <Col span={24}>
             <Form.Item label="说明" name="description">
-              <Input.TextArea maxLength={200} />
+              <Input.TextArea maxLength={200} placeholder="请输入说明" />
             </Form.Item>
           </Col>
         </Row>

+ 15 - 0
src/pages/link/Channel/Modbus/Access/bindDevice/index.tsx

@@ -55,6 +55,21 @@ const BindDevice = (props: Props) => {
       title: '状态',
       dataIndex: 'state',
       renderText: (state) => <Badge text={state?.text} status={statusMap.get(state.value)} />,
+      valueType: 'select',
+      valueEnum: {
+        online: {
+          text: '在线',
+          status: 'disabled',
+        },
+        offline: {
+          text: '离线',
+          status: 'offline',
+        },
+        notActive: {
+          text: '未激活',
+          status: 'notActive',
+        },
+      },
     },
   ];
 

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

@@ -247,7 +247,7 @@ const AddPoint = (props: Props) => {
         <Row gutter={[24, 24]}>
           <Col span={24}>
             <Form.Item label="说明" name="description">
-              <Input.TextArea maxLength={200} />
+              <Input.TextArea maxLength={200} placeholder="请输入说明" />
             </Form.Item>
           </Col>
         </Row>

+ 15 - 0
src/pages/link/Channel/Opcua/Access/bindDevice/index.tsx

@@ -54,6 +54,21 @@ const BindDevice = (props: Props) => {
       title: '状态',
       dataIndex: 'state',
       renderText: (state) => <Badge text={state?.text} status={statusMap.get(state.value)} />,
+      valueType: 'select',
+      valueEnum: {
+        online: {
+          text: '在线',
+          status: 'disabled',
+        },
+        offline: {
+          text: '离线',
+          status: 'offline',
+        },
+        notActive: {
+          text: '未激活',
+          status: 'notActive',
+        },
+      },
     },
   ];
 

+ 2 - 1
src/pages/link/Protocol/save/index.tsx

@@ -212,6 +212,7 @@ const Save = (props: Props) => {
               rows: 3,
               showCount: true,
               maxLength: 200,
+              placeholder: '请输入说明',
             },
           },
         },
@@ -259,7 +260,7 @@ const Save = (props: Props) => {
           }}
           disabled={props.data?.id ? !permission.update : !permission.add}
         >
-          保存
+          确定
         </Button>,
         // <Button
         //   key={3}

+ 2 - 2
src/pages/user/Login/index.less

@@ -127,11 +127,11 @@
   //background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
   width: 73%;
   height: 100%;
-  padding: 112px 80px;
+  // padding: 112px 80px;
   background-image: url('/images/login.png');
   background-repeat: no-repeat;
   background-position: center;
-  background-size: 100% 100%;
+  background-size: cover;
 
   .systemName {
     width: 100%;

+ 2 - 0
src/pages/user/Login/index.tsx

@@ -208,6 +208,7 @@ const Login: React.FC = () => {
                           type="link"
                           onClick={() => {
                             localStorage.setItem('onLogin', 'no');
+                            //  window.open(`/#/account/center/bind`);
                             window.open(`/${SystemConst.API_BASE}/sso/${item.provider}/login`);
                             window.onstorage = (e) => {
                               if (e.newValue) {
@@ -230,6 +231,7 @@ const Login: React.FC = () => {
           </div>
         </div>
         <div className={styles.right}>
+          {/* <img src={require('/public/images/login.png')}/> */}
           {/*<div className={styles.systemName}>{SystemConst.SYSTEM_NAME}</div>*/}
           {/*<div className={styles.systemDesc}>OPEN SOURCE INTERNET OF THINGS BASIC PLATFORM</div>*/}
         </div>