Browse Source

fix: 修改bug

sun-chaochao 3 năm trước cách đây
mục cha
commit
d33b355a51

BIN
public/images/home/comprehensive.png


BIN
public/images/home/device.png


BIN
public/images/home/ops.png


+ 1 - 1
src/pages/device/Instance/Detail/Running/Property/EditProperty.tsx

@@ -29,7 +29,7 @@ const EditProperty = (props: Props) => {
     properties: {
       propertyValue: {
         type: 'string',
-        title: '自定义属性',
+        title: data?.name || '自定义属性',
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',

+ 1 - 0
src/pages/device/Instance/Detail/Running/Property/index.tsx

@@ -95,6 +95,7 @@ const Property = (props: Props) => {
               <a
                 onClick={() => {
                   setVisible(true);
+                  setCurrentInfo(record);
                 }}
               >
                 <EditOutlined />

+ 6 - 0
src/pages/device/Instance/Export/index.less

@@ -0,0 +1,6 @@
+.alert {
+  display: flex;
+  padding: 10px;
+  color: rgba(0, 0, 0, 0.55);
+  background-color: #f6f6f6;
+}

+ 7 - 8
src/pages/device/Instance/Export/index.tsx

@@ -1,7 +1,7 @@
 import { FormItem, FormLayout, Radio, Select } from '@formily/antd';
 import { createForm } from '@formily/core';
 import { createSchemaField, FormProvider } from '@formily/react';
-import { Alert, Modal } from 'antd';
+import { Modal } from 'antd';
 import 'antd/lib/tree-select/style/index.less';
 import { useEffect, useState } from 'react';
 import { service } from '@/pages/device/Instance';
@@ -9,7 +9,8 @@ import type { DeviceInstance } from '../typings';
 import SystemConst from '@/utils/const';
 import encodeQuery from '@/utils/encodeQuery';
 import { downloadFile } from '@/utils/util';
-
+import { InfoCircleOutlined } from '@ant-design/icons';
+import styles from './index.less';
 interface Props {
   visible: boolean;
   close: () => void;
@@ -115,12 +116,10 @@ const Export = (props: Props) => {
       title="导出"
       onOk={downloadTemplate}
     >
-      <Alert
-        message="选择单个产品时可导出其下属设备的详细数据,不选择产品时导出所有设备的基础数据"
-        type="warning"
-        showIcon
-        closable
-      />
+      <div className={styles.alert}>
+        <InfoCircleOutlined style={{ margin: '5px 10px 0 0' }} />
+        <div>选择单个产品时可导出其下属设备的详细数据,不选择产品时导出所有设备的基础数</div>
+      </div>
       <div style={{ marginTop: '20px' }}>
         <FormProvider form={form}>
           <SchemaField schema={schema} />

+ 7 - 5
src/pages/device/components/Metadata/Import/index.tsx

@@ -40,11 +40,13 @@ const Import = (props: Props) => {
       paging: false,
       terms: [{ column: 'id$not', value: param.id }],
     })) as any;
-    field.dataSource = product.result.map((item: any) => ({
-      label: item.name,
-      value: item.metadata,
-      key: item.id,
-    }));
+    field.dataSource = product.result
+      .filter((i: any) => i?.metadata)
+      .map((item: any) => ({
+        label: item.name,
+        value: item.metadata,
+        key: item.id,
+      }));
     field.loading = false;
   };
 

+ 3 - 0
src/pages/home/components/DeviceChoose.tsx

@@ -43,14 +43,17 @@ export default (props: DeviceModalProps) => {
       dataIndex: 'id',
       title: '设备ID',
       width: 220,
+      ellipsis: true,
     },
     {
       dataIndex: 'name',
       title: '设备名称',
+      ellipsis: true,
     },
     {
       dataIndex: 'productName',
       title: '产品名称',
+      ellipsis: true,
     },
     {
       dataIndex: 'modifyTime',

+ 9 - 3
src/pages/home/init/index.less

@@ -1,13 +1,16 @@
+@import '~antd/es/style/themes/default.less';
+
 .homeBox {
   display: flex;
   flex-direction: column;
   align-items: center;
   width: 100%;
   height: calc(100vh - 150px);
+  padding: 20px;
   background-color: white;
 }
 .title {
-  margin-top: 48px;
+  margin-top: 28px;
   margin-bottom: 48px;
   font-weight: 400;
   font-size: 26px;
@@ -19,8 +22,11 @@
   flex-direction: column;
   align-items: center;
 
+  &.active {
+    border: 2px solid @primary-color-active;
+  }
+
   img {
-    width: 80%;
-    margin-bottom: 10px;
+    width: 100%;
   }
 }

+ 18 - 13
src/pages/home/init/index.tsx

@@ -1,4 +1,5 @@
-import { Button, Col, Radio, Row } from 'antd';
+import { Button, Col, Row } from 'antd';
+import classNames from 'classnames';
 import { useState } from 'react';
 import { service } from '..';
 import styles from './index.less';
@@ -30,18 +31,22 @@ const Init = (props: Props) => {
   return (
     <div className={styles.homeBox}>
       <div className={styles.title}>请选择首页视图</div>
-      <Radio.Group value={value} onChange={(e) => setValue(e.target.value)}>
-        <Row gutter={24}>
-          {viewMap.map((item) => (
-            <Col span={8} key={item.value}>
-              <div className={styles.item}>
-                <img src={item.img} className={styles.item} />
-                <Radio value={item.value}>{item.title}</Radio>
-              </div>
-            </Col>
-          ))}
-        </Row>
-      </Radio.Group>
+
+      <Row gutter={24}>
+        {viewMap.map((item) => (
+          <Col
+            span={8}
+            key={item.value}
+            onClick={() => {
+              setValue(item.value);
+            }}
+          >
+            <div className={classNames(styles.item, value === item.value ? styles.active : {})}>
+              <img src={item.img} className={styles.item} />
+            </div>
+          </Col>
+        ))}
+      </Row>
 
       <div style={{ textAlign: 'center', marginTop: 48 }}>
         <Button

+ 6 - 2
src/pages/link/AccessConfig/Detail/Provider/index.tsx

@@ -1,6 +1,6 @@
 import { useEffect, useState } from 'react';
 import { TitleComponent } from '@/components';
-import { Button, Card, Col, Row } from 'antd';
+import { Button, Card, Col, Row, Tooltip } from 'antd';
 import styles from './index.less';
 
 interface Props {
@@ -84,7 +84,11 @@ const Provider = (props: Props) => {
                       </div>
                       <div className={styles.context}>
                         <div style={{ fontWeight: 600 }}>{item.name}</div>
-                        <div className={styles.desc}>{item?.description || ''}</div>
+                        <div className={styles.desc}>
+                          <Tooltip title={item?.description || ''}>
+                            {item?.description || ''}
+                          </Tooltip>
+                        </div>
                       </div>
                     </div>
                     <div style={{ width: '70px' }}>

+ 11 - 0
src/pages/notice/Config/Log/index.tsx

@@ -25,6 +25,17 @@ const Log = observer(() => {
     {
       dataIndex: 'state',
       title: '状态',
+      valueType: 'select',
+      valueEnum: {
+        success: {
+          text: '成功',
+          status: 'success',
+        },
+        error: {
+          text: '失败',
+          status: 'error',
+        },
+      },
       renderText: (text: { value: string; text: string }, record) => {
         return (
           <>

+ 11 - 0
src/pages/notice/Template/Log/index.tsx

@@ -25,6 +25,17 @@ const Log = observer(() => {
     {
       dataIndex: 'state',
       title: '状态',
+      valueType: 'select',
+      valueEnum: {
+        success: {
+          text: '成功',
+          status: 'success',
+        },
+        error: {
+          text: '失败',
+          status: 'error',
+        },
+      },
       renderText: (text: { value: string; text: string }, record) => {
         return (
           <>

+ 1 - 4
src/pages/system/Permission/Save/index.tsx

@@ -219,10 +219,7 @@ const Save = (props: Props) => {
           add: {
             type: 'void',
             'x-component': 'ArrayTable.Addition',
-            title: intl.formatMessage({
-              id: 'pages.system.permission.add',
-              defaultMessage: '添加条目',
-            }),
+            title: '添加',
           },
         },
       },