Browse Source

feat: merge

xieyonghong 3 years ago
parent
commit
cf816c7b21

+ 1 - 0
src/components/ProTableCard/CardItems/Scene/index.less

@@ -77,6 +77,7 @@
                 overflow: hidden;
                 overflow: hidden;
                 .right-item-right-item-contents-item {
                 .right-item-right-item-contents-item {
                   display: flex;
                   display: flex;
+                  align-items: center;
                   color: rgba(0, 0, 0, 0.65);
                   color: rgba(0, 0, 0, 0.65);
                 }
                 }
               }
               }

+ 10 - 3
src/components/ProTableCard/CardItems/Scene/index.tsx

@@ -306,8 +306,15 @@ const branchesActionRender = (actions: any[]) => {
 
 
     return list.map((item, index) => (
     return list.map((item, index) => (
       <div className={styles['right-item-right-item-contents-item']}>
       <div className={styles['right-item-right-item-contents-item']}>
-        <div style={{ minWidth: 40 }}>动作{index + 1}</div>
-        {item}
+        <div style={{ margin: '0 10px' }}>{item}</div>
+        <MyTooltip title={actions[index]?.options?.terms || ''}>
+          {actions[index]?.options?.terms && (
+            <div className={'ellipsis'} style={{ minWidth: 40 }}>
+              动作{index + 1}
+              {actions[index]?.options?.terms}
+            </div>
+          )}
+        </MyTooltip>
       </div>
       </div>
     ));
     ));
   }
   }
@@ -390,7 +397,7 @@ const ContentRender = (data: SceneCardProps) => {
               );
               );
             },
             },
           )}
           )}
-          {(data?.branches || []).length > 1 && (
+          {(data?.branches || []).length > 2 && (
             <div
             <div
               className={styles['trigger-actions-more']}
               className={styles['trigger-actions-more']}
               onClick={(e) => {
               onClick={(e) => {

+ 1 - 0
src/pages/rule-engine/Scene/Save/action/DeviceOutput/device/index.tsx

@@ -364,6 +364,7 @@ export default observer((props: Props) => {
                     if (selectedRows.length) {
                     if (selectedRows.length) {
                       const item = selectedRows?.[0];
                       const item = selectedRows?.[0];
                       DeviceModel.deviceId = item.id;
                       DeviceModel.deviceId = item.id;
+                      DeviceModel.deviceDetail = item;
                       DeviceModel.selectorValues = [
                       DeviceModel.selectorValues = [
                         { value: DeviceModel.deviceId, name: item.name },
                         { value: DeviceModel.deviceId, name: item.name },
                       ];
                       ];

+ 6 - 3
src/pages/rule-engine/Scene/Save/action/DeviceOutput/index.tsx

@@ -75,10 +75,10 @@ export default observer((props: Props) => {
       productId: DeviceModel.productId,
       productId: DeviceModel.productId,
       message: value.device.message,
       message: value.device.message,
     };
     };
-    console.log(item, value);
+    // console.log(item, value);
 
 
     const _options: any = {
     const _options: any = {
-      name: '', //设备名称
+      name: '-', //设备名称
       type: '', //类型
       type: '', //类型
       properties: '', //属性功能
       properties: '', //属性功能
       selector: DeviceModel.selector, //选择器标识
       selector: DeviceModel.selector, //选择器标识
@@ -95,10 +95,12 @@ export default observer((props: Props) => {
     if (_type === 'READ_PROPERTY') {
     if (_type === 'READ_PROPERTY') {
       _options.type = '读取';
       _options.type = '读取';
       _options.properties = value.device.message.properties?.[0];
       _options.properties = value.device.message.properties?.[0];
+      // _options.name = DeviceModel.selectorValues[0].name;
     }
     }
     if (_type === 'WRITE_PROPERTY') {
     if (_type === 'WRITE_PROPERTY') {
       _options.type = '设置';
       _options.type = '设置';
       _options.properties = Object.keys(value.device.message.properties)?.[0];
       _options.properties = Object.keys(value.device.message.properties)?.[0];
+      // _options.name = DeviceModel.selectorValues[0].name;
     }
     }
     if (_options.selector === 'tag') {
     if (_options.selector === 'tag') {
       _options.taglist = DeviceModel.selectorValues?.[0]?.value.map((it: any) => ({
       _options.taglist = DeviceModel.selectorValues?.[0]?.value.map((it: any) => ({
@@ -108,7 +110,8 @@ export default observer((props: Props) => {
       }));
       }));
       // console.log(_options.taglist, 'taglist')
       // console.log(_options.taglist, 'taglist')
     }
     }
-    // console.log(_options);
+    console.log(_options);
+    console.log(DeviceModel.deviceDetail.name);
     // console.log('device', item);
     // console.log('device', item);
     props.save(item, _options);
     props.save(item, _options);
     // FormModel.actions[props.name].options = _options;
     // FormModel.actions[props.name].options = _options;

+ 1 - 1
src/pages/rule-engine/Scene/Save/action/ListItem/List.tsx

@@ -69,7 +69,7 @@ export default (props: ListProps) => {
             console.log(data);
             console.log(data);
 
 
             const { type, ...extra } = data;
             const { type, ...extra } = data;
-            console.log('list', data);
+            console.log('list', options);
             const item: ActionsType = {
             const item: ActionsType = {
               ...extra,
               ...extra,
               executor: data.type === 'trigger' || data.type === 'relieve' ? 'alarm' : data.type,
               executor: data.type === 'trigger' || data.type === 'relieve' ? 'alarm' : data.type,