Browse Source

fix: 修改手动触发

100011797 3 years ago
parent
commit
1a734c118c

+ 3 - 3
src/pages/device/Instance/Detail/MetadataLog/Property/Detail.tsx

@@ -23,7 +23,7 @@ const Detail = (props: Props) => {
                 displayDataTypes={false}
                 style={{ marginTop: 10 }}
                 name={false}
-                src={value}
+                src={value?.formatValue}
               />
             }
           </div>
@@ -33,14 +33,14 @@ const Detail = (props: Props) => {
       return (
         <div>
           <div>自定义属性</div>
-          <Input.TextArea value={value} rows={3} />
+          <Input.TextArea value={value?.formatValue} rows={3} />
         </div>
       );
     } else {
       return (
         <div>
           <div>自定义属性</div>
-          <Input value={value} disabled />
+          <Input value={value?.formatValue} disabled />
         </div>
       );
     }

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

@@ -93,7 +93,7 @@ const PropertyLog = (props: Props) => {
             <SearchOutlined
               onClick={() => {
                 setDetailVisible(true);
-                setCurrent(record.value);
+                setCurrent(record);
               }}
             />
           )}

+ 3 - 2
src/pages/link/DataCollect/DataGathering/index.less

@@ -3,8 +3,9 @@
   min-height: calc(100vh - 180px);
   .left {
     width: 300px;
-    margin-right: 20px;
-    padding: 10px;
+    margin-top: 24px;
+    margin-right: 12px;
+    padding-right: 10px;
     border-right: 1px solid #eee;
   }
   .right {

+ 1 - 1
src/pages/link/DataCollect/DataGathering/index.tsx

@@ -46,7 +46,7 @@ export default observer(() => {
 
   return (
     <PageContainer>
-      <Card bordered={false}>
+      <Card bordered={false} bodyStyle={{ paddingTop: 0 }}>
         <div className={styles.container}>
           <div className={styles.left}>
             <ChannelTree

+ 1 - 0
src/pages/link/DataCollect/components/Device/index.tsx

@@ -219,6 +219,7 @@ export default observer((props: Props) => {
         loading={loading}
         style={{ minHeight, position: 'relative' }}
         className={'data-collect-collector'}
+        bodyStyle={{ paddingTop: !props.type ? 4 : 24 }}
       >
         <div>
           <div style={{ paddingBottom: 48, height: '100%' }}>

+ 3 - 0
src/pages/link/DataCollect/components/Point/Save/modbus.tsx

@@ -355,6 +355,9 @@ export default (props: Props) => {
             'x-decorator': 'FormItem',
             'x-decorator-props': {
               gridSpan: 2,
+              style: {
+                marginBottom: 8,
+              },
             },
             default: 3000,
             'x-component-props': {

+ 3 - 0
src/pages/link/DataCollect/components/Point/Save/opc-ua.tsx

@@ -166,6 +166,9 @@ export default (props: Props) => {
             'x-decorator': 'FormItem',
             'x-decorator-props': {
               gridSpan: 2,
+              style: {
+                marginBottom: 8,
+              },
             },
             default: 3000,
             'x-component-props': {

+ 1 - 0
src/pages/link/DataCollect/components/Point/index.tsx

@@ -212,6 +212,7 @@ const PointCard = observer((props: PointCardProps) => {
         bordered={false}
         className={'data-collect-point'}
         style={{ position: 'relative', minHeight }}
+        bodyStyle={{ paddingTop: !props.type ? 4 : 24 }}
       >
         <div>
           <div style={{ height: '100%', paddingBottom: 48 }}>

+ 6 - 0
src/pages/link/DataCollect/components/Tree/index.less

@@ -1,3 +1,9 @@
+.data-collect-tree {
+  :global(.ant-tree-node-selected) {
+    background-color: rgba(47, 84, 235, 0.06) !important;
+  }
+}
+
 .treeTitle {
   display: flex;
   align-items: center;

+ 2 - 0
src/pages/link/DataCollect/components/Tree/index.tsx

@@ -139,7 +139,9 @@ export default observer((props: Props) => {
         {TreeModel.dataSource.length ? (
           <Tree
             style={{ overflow: 'hidden' }}
+            className={styles['data-collect-tree']}
             showIcon
+            height={500}
             selectedKeys={TreeModel.selectedKeys}
             switcherIcon={<DownOutlined />}
           >

+ 5 - 5
src/pages/media/DashBoard/index.tsx

@@ -141,11 +141,11 @@ export default () => {
           type: 'value',
           // minInterval: 1,
         },
-        // grid: {
-        //   left: '4%',
-        //   right: '2%',
-        //   top: '2%',
-        // },
+        grid: {
+          left: 0,
+          right: 0,
+          top: '2%',
+        },
         color: ['#2F54EB'],
         series: [
           {

+ 12 - 2
src/pages/rule-engine/Alarm/Configuration/index.tsx

@@ -196,7 +196,12 @@ const Configuration = () => {
               disabled: record.state?.value === 'disabled',
               title: '确认手动触发?',
               onConfirm: async () => {
-                await service._execute(record.sceneId);
+                const scene = (record?.scene || [])
+                  .filter((item: any) => item?.triggerType === 'manual')
+                  .map((i) => {
+                    return { id: i?.id };
+                  });
+                await service._execute(scene);
                 onlyMessage(
                   intl.formatMessage({
                     id: 'pages.data.option.success',
@@ -334,7 +339,12 @@ const Configuration = () => {
                     title: '确认手动触发?',
                     disabled: record.state?.value === 'disabled',
                     onConfirm: async () => {
-                      await service._execute(record.sceneId);
+                      const scene = (record?.scene || [])
+                        .filter((item: any) => item?.triggerType === 'manual')
+                        .map((i: any) => {
+                          return { id: i?.id };
+                        });
+                      await service._execute(scene);
                       onlyMessage(
                         intl.formatMessage({
                           id: 'pages.data.option.success',

+ 3 - 3
src/pages/rule-engine/Alarm/Configuration/service.ts

@@ -33,10 +33,10 @@ class Service extends BaseService<ConfigItem> {
     request(`/${SystemConst.API_BASE}/alarm/config/${id}/_disable`, {
       method: 'POST',
     });
-  public _execute = (id: string) =>
-    request(`/${SystemConst.API_BASE}/scene/${id}/_execute`, {
+  public _execute = (data: any) =>
+    request(`/${SystemConst.API_BASE}/scene/batch/_execute`, {
       method: 'POST',
-      data: {},
+      data,
     });
 
   public getAlarmCountById = (id: string) =>

+ 2 - 5
src/pages/system/DataSource/Save/index.tsx

@@ -96,6 +96,7 @@ const Save = (props: Props) => {
               },
             ],
             required: true,
+            'x-disabled': !!props.data.id,
             enum: Store.get('datasource-type'),
           },
           'shareConfig.url': {
@@ -360,11 +361,7 @@ const Save = (props: Props) => {
         props.close();
       }}
       onOk={() => {
-        if ((props.data.id && props.data.typeId === 'rdb') || !props.data.id) {
-          handleSave();
-        } else {
-          onlyMessage('该类型数据库不可以编辑', 'warning');
-        }
+        handleSave();
       }}
     >
       <Form form={form} layout="vertical">

+ 7 - 2
src/pages/system/DataSource/index.tsx

@@ -139,13 +139,18 @@ const DataSource = observer(() => {
           type="link"
           isPermission={userPermission.manage}
           key="manage"
-          disabled={record.state?.value !== 'enabled'}
+          disabled={record.state?.value !== 'enabled' || record?.typeId === 'rabbitmq'}
           onClick={() => {
             const url = getMenuPathByCode(MENUS_CODE[`system/DataSource/Management`]);
             history.push(`${url}?id=${record.id}`);
           }}
           tooltip={{
-            title: record.state?.value !== 'enabled' ? '请先启用数据源' : '管理',
+            title:
+              record?.typeId === 'rabbitmq'
+                ? '暂不支持管理功能'
+                : record.state?.value !== 'enabled'
+                ? '请先启用数据源'
+                : '管理',
           }}
         >
           <DatabaseOutlined />

+ 7 - 1
src/pages/system/Role/Detail/Permission/index.tsx

@@ -97,7 +97,13 @@ const Permission = () => {
               <Form.Item
                 label="名称"
                 name="name"
-                rules={[{ required: true, message: '请输入名称!' }]}
+                rules={[
+                  { required: true, message: '请输入名称!' },
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ]}
               >
                 <Input />
               </Form.Item>

+ 9 - 4
src/pages/system/User/Save/index.tsx

@@ -338,8 +338,10 @@ const Save = (props: Props) => {
               gridSpan: 1,
               addonAfter: (
                 <PermissionButton
-                  type="link"
-                  style={{ padding: 0 }}
+                  // type="link"
+                  type="primary"
+                  ghost
+                  style={{ padding: '0 8px' }}
                   isPermission={rolePermission.add}
                   onClick={() => {
                     const tab: any = window.open(`${origin}/#/system/role?save=true`);
@@ -383,8 +385,11 @@ const Save = (props: Props) => {
               gridSpan: 1,
               addonAfter: (
                 <PermissionButton
-                  type="link"
-                  style={{ padding: 0 }}
+                  // type="link"
+                  // style={{ padding: 0 }}
+                  type="primary"
+                  ghost
+                  style={{ padding: '0 8px' }}
                   isPermission={deptPermission.add}
                   onClick={() => {
                     const tab: any = window.open(`${origin}/#/system/department?save=true`);