Explorar o código

fix: 通知配置

100011797 %!s(int64=3) %!d(string=hai) anos
pai
achega
02543e3086

BIN=BIN
public/images/scene/action-bind-icon.png


BIN=BIN
public/images/scene/action-delay-icon.png


BIN=BIN
public/images/scene/action-device-icon.png


BIN=BIN
public/images/scene/action-notify-icon.png


BIN=BIN
public/images/scene/action-unbind-icon.png


+ 24 - 9
src/components/ProTableCard/CardItems/Scene/index.tsx

@@ -200,8 +200,20 @@ const deviceRender = (data: ActionsType | undefined) => {
     case 'relation':
       return (
         <div>
-          {data?.options?.type || ''}
-          与【触发设备】具有相同【关系名称】的【产品名称】设备的【属性/功能】
+          {data?.options?.type || ''}与
+          <span className={styles['notify-text-highlight']}>{data?.options?.deviceName || ''}</span>
+          具有相同
+          <span className={styles['notify-text-highlight']}>
+            {data?.options?.relationName || ''}
+          </span>
+          的
+          <span className={styles['notify-text-highlight']}>
+            {data?.options?.productName || ''}
+          </span>
+          设备的
+          <span className={styles['notify-text-highlight']}>
+            {data?.options?.propertyName || data?.options?.functionName || ''}
+          </span>
         </div>
       );
     case 'tag':
@@ -221,11 +233,12 @@ const deviceRender = (data: ActionsType | undefined) => {
     default:
       return (
         <div>
-          {data?.options?.type || ''}
-          <span className={styles['notify-text-highlight']}>{data?.options?.deviceName || ''}</span>
-          <span className={styles['notify-text-highlight']}>
-            {data?.options?.propertyName || data?.options?.functionName || ''}
-          </span>
+          {/*{data?.options?.type || ''}*/}
+          {/*<span className={styles['notify-text-highlight']}>{data?.options?.deviceName || ''}</span>*/}
+          {/*<span className={styles['notify-text-highlight']}>*/}
+          {/*  {data?.options?.propertyName || data?.options?.functionName || ''}*/}
+          {/*</span>*/}
+          打开空调动作1执行结果=成功并且 湿度24
         </div>
       );
   }
@@ -297,8 +310,10 @@ const branchesActionRender = (actions: any[]) => {
   if (actions && actions?.length) {
     const list: any[] = [];
     actions.map((item, index) => {
-      list.push(actionRender(item, index));
+      const dt = actionRender(item, index);
+      list.push(dt);
     });
+
     return list.map((item, index) => (
       <div className={styles['right-item-right-item-contents-item']}>
         <div style={{ minWidth: 40 }}>动作{index + 1}</div>
@@ -308,6 +323,7 @@ const branchesActionRender = (actions: any[]) => {
   }
   return '';
 };
+
 const ContentRender = (data: SceneCardProps) => {
   const [visible, setVisible] = useState<boolean>(false);
   const type = data.triggerType;
@@ -411,7 +427,6 @@ const ContentRender = (data: SceneCardProps) => {
                     <div className={styles['card-item-content-action-item-right-item']}>
                       <div className={styles['right-item-right']}>
                         {(item?.then || []).map((i: BranchesThen, _index: number) => {
-                          console.log(i);
                           return (
                             <div key={i?.key || _index} className={styles['right-item-right-item']}>
                               <div className={styles['trigger-ways']}>

+ 28 - 12
src/pages/rule-engine/Scene/Save/action/ListItem/Item.tsx

@@ -152,7 +152,12 @@ export default (props: ItemProps) => {
       );
     } else if (props?.data?.alarm?.mode === 'relieve') {
       return (
-        <div>
+        <div
+          className={'item-options-content'}
+          onClick={() => {
+            setVisible(true);
+          }}
+        >
           满足条件后将解除关联
           <a
             onClick={() => {
@@ -164,9 +169,27 @@ export default (props: ItemProps) => {
         </div>
       );
     } else if (props?.data?.executor === 'notify') {
-      return notifyRender(props?.data);
+      return (
+        <div
+          className={'item-options-content'}
+          onClick={() => {
+            setVisible(true);
+          }}
+        >
+          {notifyRender(props?.data)}
+        </div>
+      );
     } else if (props?.data?.executor === 'delay') {
-      return <div> {props.options.name}</div>;
+      return (
+        <div
+          className={'item-options-content'}
+          onClick={() => {
+            setVisible(true);
+          }}
+        >
+          {props.options.name}
+        </div>
+      );
     } else if (props.data?.executor === 'device') {
       return <div></div>;
     }
@@ -187,20 +210,13 @@ export default (props: ItemProps) => {
         <div className="item-options-warp">
           <div className="item-options-type">
             <img
-              style={{ width: 48 }}
+              style={{ width: 18 }}
               src={iconMap.get(
                 props?.data.executor === 'alarm' ? props?.data?.alarm?.mode : props?.data.executor,
               )}
             />
           </div>
-          <div
-            className={'item-options-content'}
-            onClick={() => {
-              setVisible(true);
-            }}
-          >
-            {contentRender()}
-          </div>
+          {contentRender()}
         </div>
         <div className="item-number">{props.name + 1}</div>
         <div className="item-delete" onClick={props.onDelete}>

+ 3 - 2
src/pages/rule-engine/Scene/Save/action/ListItem/index.less

@@ -27,15 +27,16 @@
       align-items: center;
       justify-content: center;
       width: 48px;
+      height: 48px;
       margin-right: 8px;
-      background: rgba(47, 84, 235, 0.08);
+      background-color: #fafafa;
     }
 
     .item-options-content {
       display: flex;
       align-items: center;
       padding: 0 8px;
-      background: rgba(47, 84, 235, 0.08);
+      background: #fafafa;
       cursor: pointer;
       div {
         padding: 6px 10px;