Преглед изворни кода

fix: bug#9050、9169、8691、8692、8756、8690、8844

xieyonghong пре 3 година
родитељ
комит
de3d82f3b4
25 измењених фајлова са 346 додато и 193 уклоњено
  1. 1 1
      public/icons/iconfont.js
  2. 1 1
      src/components/DashBoard/index.less
  3. 21 0
      src/components/RadioCard/index.less
  4. 3 1
      src/components/RadioCard/index.tsx
  5. 0 2
      src/pages/device/Instance/index.tsx
  6. 4 2
      src/pages/media/DashBoard/index.tsx
  7. 6 5
      src/pages/media/Device/Channel/index.tsx
  8. 19 3
      src/pages/media/Device/Playback/index.tsx
  9. 2 2
      src/pages/media/Device/Save/index.tsx
  10. 20 18
      src/pages/rule-engine/Scene/Save/action/ListItem/FilterCondition.tsx
  11. 2 1
      src/pages/rule-engine/Scene/Save/action/ListItem/FilterGroup.tsx
  12. 123 118
      src/pages/rule-engine/Scene/Save/action/ListItem/Item.tsx
  13. 1 0
      src/pages/rule-engine/Scene/Save/action/ListItem/List.tsx
  14. 8 0
      src/pages/rule-engine/Scene/Save/action/ListItem/index.less
  15. 7 7
      src/pages/rule-engine/Scene/Save/action/index.tsx
  16. 1 1
      src/pages/rule-engine/Scene/Save/components/Buttons/useOption.tsx
  17. 1 1
      src/pages/rule-engine/Scene/Save/device/index.tsx
  18. 5 3
      src/pages/rule-engine/Scene/Save/index.tsx
  19. 16 1
      src/pages/rule-engine/Scene/Save/terms/index.less
  20. 20 20
      src/pages/rule-engine/Scene/Save/terms/paramsItem.tsx
  21. 10 1
      src/pages/rule-engine/Scene/Save/terms/term.tsx
  22. 2 3
      src/pages/system/DataSource/index.tsx
  23. 36 1
      src/pages/system/Department/Assets/product/bind.tsx
  24. 36 1
      src/pages/system/Department/Assets/product/index.tsx
  25. 1 0
      src/pages/system/Department/typings.d.ts

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
public/icons/iconfont.js


+ 1 - 1
src/components/DashBoard/index.less

@@ -9,7 +9,7 @@
 .header {
   display: flex;
   gap: 20px;
-  padding: 8px 0;
+  padding-bottom: 8px;
 }
 
 .title {

+ 21 - 0
src/components/RadioCard/index.less

@@ -70,6 +70,27 @@
         display: block;
       }
     }
+
+    &.disabled {
+      color: @disabled-color;
+      border-color: @disabled-bg;
+      cursor: not-allowed;
+
+      .checked-icon {
+        background-color: @disabled-active-bg;
+      }
+
+      &:hover,
+      &:focus {
+        color: @disabled-color;
+        border-color: @disabled-active-bg;
+      }
+
+      &.checked {
+        color: @disabled-color;
+        border-color: @disabled-active-bg;
+      }
+    }
   }
 
   &.disabled {

+ 3 - 1
src/components/RadioCard/index.tsx

@@ -11,6 +11,7 @@ interface RadioCardItem {
   value: string;
   imgUrl?: string;
   imgSize?: number[];
+  disabled?: boolean;
 }
 
 export interface RadioCardProps {
@@ -72,11 +73,12 @@ export default (props: RadioCardProps) => {
           <div
             className={classNames('radio-card-item', {
               checked: keys?.includes(item.value),
+              disabled: item.disabled,
             })}
             style={props.itemStyle}
             key={item.value}
             onClick={() => {
-              if (!props.disabled) {
+              if (!props.disabled && !item.disabled) {
                 toggleOption(item.value);
               }
             }}

+ 0 - 2
src/pages/device/Instance/index.tsx

@@ -89,8 +89,6 @@ const Instance = () => {
         });
       });
 
-      console.log(_terms);
-
       if (location.state && location.state?.save) {
         setVisible(true);
         setCurrent({});

+ 4 - 2
src/pages/media/DashBoard/index.tsx

@@ -9,6 +9,7 @@ import type { EChartsOption } from 'echarts';
 import moment from 'moment';
 import { Tooltip } from 'antd';
 import { QuestionCircleOutlined } from '@ant-design/icons';
+import { useDomFullHeight } from '@/hooks';
 
 const service = new Service('media');
 
@@ -18,6 +19,7 @@ export default () => {
   const [channelOnline, setChannelOnline] = useState(0);
   const [channelOffline, setChannelOffline] = useState(0);
   const [options, setOptions] = useState<EChartsOption>({});
+  const { minHeight } = useDomFullHeight(`.media-dash-board-body`);
 
   const { data: deviceTotal } = useRequest(service.deviceCount, {
     formatResult: (res) => res.result,
@@ -142,7 +144,7 @@ export default () => {
           // minInterval: 1,
         },
         grid: {
-          left: 0,
+          left: '80px',
           right: 0,
           top: '2%',
         },
@@ -269,7 +271,7 @@ export default () => {
           className={'media-dash-board-body'}
           title={'播放数量(人次)'}
           options={options}
-          height={500}
+          height={minHeight < 500 ? 500 : minHeight}
           defaultTime={'week'}
           onParamsChange={getEcharts}
         />

+ 6 - 5
src/pages/media/Device/Channel/index.tsx

@@ -6,7 +6,7 @@ import './index.less';
 import { useEffect, useRef, useState } from 'react';
 import { ChannelItem } from '@/pages/media/Device/Channel/typings';
 import { useHistory, useIntl, useLocation } from 'umi';
-import { BadgeStatus } from '@/components';
+import { AIcon, BadgeStatus } from '@/components';
 import { StatusColorEnum } from '@/components/BadgeStatus';
 import { Button, message, Popconfirm, Tooltip } from 'antd';
 import {
@@ -14,7 +14,6 @@ import {
   EditOutlined,
   LeftOutlined,
   PlusOutlined,
-  VideoCameraAddOutlined,
   VideoCameraOutlined,
 } from '@ant-design/icons';
 import Save from './Save';
@@ -139,7 +138,7 @@ export default () => {
       }),
       valueType: 'option',
       align: 'left',
-      width: 200,
+      width: 160,
       render: (_, record) => [
         <Tooltip
           key="edit"
@@ -173,14 +172,16 @@ export default () => {
         <Tooltip key={'playback'} title={'回放'}>
           <a
             onClick={() => {
+              const param = new URLSearchParams(location.search);
+              const _type = param.get('type');
               history.push(
                 `${getMenuPathByCode(MENUS_CODE['media/Device/Playback'])}?id=${
                   record.deviceId
-                }&channelId=${record.channelId}`,
+                }&channelId=${record.channelId}&type=${_type}`,
               );
             }}
           >
-            <VideoCameraAddOutlined />
+            <AIcon type={'icon-huifang'} />
           </a>
         </Tooltip>,
         type === ProviderValue.FIXED ? (

+ 19 - 3
src/pages/media/Device/Playback/index.tsx

@@ -104,6 +104,8 @@ export default () => {
   const deviceId = param.get('id');
   const channelId = param.get('channelId');
 
+  const [deviceType, setDeviceType] = useState('');
+
   const queryLocalRecords = async (date: Moment) => {
     setPlayStatus(0);
     setUrl('');
@@ -198,9 +200,22 @@ export default () => {
   };
 
   useEffect(() => {
-    setTime(moment(new Date()));
-    queryLocalRecords(moment(new Date()));
-  }, []);
+    const _param = new URLSearchParams(location.search);
+    const _type = _param.get('type');
+
+    if (_type) {
+      setDeviceType(_type);
+      const _timeStr = moment(new Date());
+      setTime(_timeStr);
+      if (_type === 'fixed-media') {
+        setType('cloud');
+        queryServiceRecords(_timeStr);
+      } else {
+        queryLocalRecords(_timeStr);
+        setType('local');
+      }
+    }
+  }, [location]);
 
   return (
     <PageContainer>
@@ -299,6 +314,7 @@ export default () => {
                   label: '本地',
                   value: 'local',
                   imgUrl: require('/public/images/local.png'),
+                  disabled: deviceType === 'fixed-media',
                 },
               ]}
             />

+ 2 - 2
src/pages/media/Device/Save/index.tsx

@@ -170,12 +170,12 @@ const Save = () => {
                   </Col>
                 </Row>
                 <Row>
-                  <Col span={8}>
+                  <Col flex={'184px'}>
                     <Form.Item name={'photoUrl'}>
                       <UploadImage />
                     </Form.Item>
                   </Col>
-                  <Col span={16}>
+                  <Col flex={'auto'}>
                     {accessType === DefaultAccessType ? (
                       <Form.Item
                         label={'ID'}

+ 20 - 18
src/pages/rule-engine/Scene/Save/action/ListItem/FilterCondition.tsx

@@ -14,6 +14,7 @@ interface FilterProps {
   action?: number;
   data: TermsType;
   isLast: boolean;
+  isFirst: boolean;
   onChange?: (value: TermsType | any) => void;
   onValueChange: (value: TermsType) => void;
   onLabelChange: (lb: any[]) => void;
@@ -146,6 +147,24 @@ export default observer((props: FilterProps) => {
 
   return (
     <div className="filter-condition-warp">
+      {!props.isFirst && (
+        <div className="term-type-warp">
+          <DropdownButton
+            options={[
+              { title: '并且', key: 'and' },
+              { title: '或者', key: 'or' },
+            ]}
+            isTree={false}
+            type="type"
+            value={props.data.type}
+            onChange={(v) => {
+              props.data.type = v;
+              labelCache.current[3] = v;
+              props.onLabelChange?.([...labelCache.current]);
+            }}
+          />
+        </div>
+      )}
       <div
         className="filter-condition-content"
         onMouseOver={() => {
@@ -337,24 +356,7 @@ export default observer((props: FilterProps) => {
           />
         )}
       </div>
-      {!props.isLast ? (
-        <div className="term-type-warp">
-          <DropdownButton
-            options={[
-              { title: '并且', key: 'and' },
-              { title: '或者', key: 'or' },
-            ]}
-            isTree={false}
-            type="type"
-            value={props.data.type}
-            onChange={(v) => {
-              props.data.type = v;
-              labelCache.current[3] = v;
-              props.onLabelChange?.([...labelCache.current]);
-            }}
-          />
-        </div>
-      ) : (
+      {props.isLast && (
         <div className="terms-add" onClick={props.onAdd}>
           <div className="terms-content">
             <PlusOutlined style={{ fontSize: 12 }} />

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

@@ -110,6 +110,7 @@ export default observer((props: TermsProps) => {
                     options={props.paramsOptions}
                     label={labelRef.current?.terms?.[index]}
                     isLast={index === props.data.terms!.length - 1}
+                    isFirst={index === 0}
                     onDelete={() => {
                       terms.splice(index, 1);
                       if (terms.length === 0) {
@@ -119,9 +120,9 @@ export default observer((props: TermsProps) => {
                           ...props.data,
                           terms: terms,
                         });
+                        props.onColumnsChange(optionsColumnsRef.current);
                       }
                       set(optionsColumnsRef.current, [props.name, index], []);
-                      props.onColumnsChange(optionsColumnsRef.current);
                     }}
                     onAdd={() => {
                       const key = `params_${new Date().getTime()}`;

+ 123 - 118
src/pages/rule-engine/Scene/Save/action/ListItem/Item.tsx

@@ -32,6 +32,7 @@ interface ItemProps {
   options: any;
   onUpdate: (data: any, options: any) => void;
   onDelete: () => void;
+  isLast: boolean;
 }
 
 const iconMap = new Map();
@@ -380,102 +381,123 @@ export default (props: ItemProps) => {
           </div>
         </Popconfirm>
       </div>
-      <div
-        className={classNames('actions-item-filter-warp', { 'filter-border': !!thenTerms?.length })}
-      >
-        {!!thenTerms?.length && (
-          <div className={'actions-item-filter-warp-tip'}>满足此条件后才会执行后续条件</div>
-        )}
-        <div className={classNames('actions-item-filter-overflow')}>
-          {props.parallel ? null : thenTerms && thenTerms.length ? (
-            thenTerms.map((termsItem, index) => (
-              <FilterGroup
-                action={props.name}
-                key={termsItem.key}
-                branchGroup={props.branchGroup}
-                branchesName={props.branchesName}
-                name={index}
-                data={termsItem}
-                columns={optionsColumns}
-                isLast={index === thenTerms.length - 1}
-                paramsOptions={paramsOptions}
-                label={props.options?.terms?.[index]}
-                actionColumns={props.options?.otherColumns}
-                onColumnsChange={(columns) => {
-                  const filterColumns = new Set(flattenDeep(columns)); // 平铺去重
-                  let newColumns = [...filterColumns.values()];
-                  if (optionsRef.current?.otherColumns) {
-                    newColumns = [...optionsRef.current.otherColumns, ...newColumns];
-                  }
-                  optionsRef.current['columns'] = newColumns;
-                  optionsRef.current['termsColumns'] = columns;
-                  props.onUpdate(cacheValueRef.current, optionsRef.current);
-                }}
-                onAddGroup={() => {
-                  const newThenTerms = [...thenTerms];
-                  newThenTerms.push({
-                    type: 'and',
-                    key: randomString(),
-                    terms: [
-                      {
-                        column: undefined,
-                        value: undefined,
-                        termType: undefined,
-                        type: 'and',
-                        key: randomString(),
-                      },
-                    ],
-                  });
-                  const _data = cacheValueRef.current;
-                  set(_data, 'terms', newThenTerms);
-                  props.onUpdate(_data, optionsRef.current);
-                }}
-                onValueChange={(termsData) => {
-                  const _data = cacheValueRef.current;
-                  set(_data, ['terms', index], termsData);
-                  // cacheValueRef.current = _data;
-                  props.onUpdate(_data, {
-                    ...optionsRef.current,
-                  });
-                }}
-                onLabelChange={(lb) => {
-                  const newLabel: any[] = props.options?.terms || [];
-                  newLabel.splice(index, 1, lb);
-                  optionsRef.current['terms'] = newLabel;
-                  props.onUpdate(cacheValueRef.current, optionsRef.current);
-                }}
-                onDelete={() => {
-                  const _data = thenTerms.filter((a) => a.key !== termsItem.key);
-                  if (optionsRef.current?.termsColumns) {
-                    optionsRef.current.termsColumns[index] = [];
-                    const filterColumns = new Set(flattenDeep(optionsRef.current.termsColumns)); // 平铺去重
+      {!props.isLast && (
+        <div
+          className={classNames('actions-item-filter-warp', {
+            'filter-border': !!thenTerms?.length,
+          })}
+        >
+          {!!thenTerms?.length && (
+            <div className={'actions-item-filter-warp-tip'}>满足此条件后才会执行后续条件</div>
+          )}
+          <div className={classNames('actions-item-filter-overflow')}>
+            {props.parallel ? null : thenTerms && thenTerms.length ? (
+              thenTerms.map((termsItem, index) => (
+                <FilterGroup
+                  action={props.name}
+                  key={termsItem.key}
+                  branchGroup={props.branchGroup}
+                  branchesName={props.branchesName}
+                  name={index}
+                  data={termsItem}
+                  columns={optionsColumns}
+                  isLast={index === thenTerms.length - 1}
+                  paramsOptions={paramsOptions}
+                  label={props.options?.terms?.[index]}
+                  actionColumns={props.options?.otherColumns}
+                  onColumnsChange={(columns) => {
+                    const filterColumns = new Set(flattenDeep(columns)); // 平铺去重
                     let newColumns = [...filterColumns.values()];
                     if (optionsRef.current?.otherColumns) {
                       newColumns = [...optionsRef.current.otherColumns, ...newColumns];
                     }
                     optionsRef.current['columns'] = newColumns;
-                  }
-                  props.onUpdate(
-                    {
-                      ...cacheValueRef.current,
-                      terms: _data,
-                    },
-                    optionsRef.current,
-                  );
-                }}
-              />
-            ))
-          ) : (
-            <div
-              className="filter-add-button"
-              onClick={() => {
-                getParams();
-                let _data = cacheValueRef.current;
-                optionsRef.current['terms'] = [];
-                if (!_data.terms) {
-                  _data = {
-                    ..._data,
-                    terms: [
+                    optionsRef.current['termsColumns'] = columns;
+                    props.onUpdate(cacheValueRef.current, optionsRef.current);
+                  }}
+                  onAddGroup={() => {
+                    const newThenTerms = [...thenTerms];
+                    newThenTerms.push({
+                      type: 'and',
+                      key: randomString(),
+                      terms: [
+                        {
+                          column: undefined,
+                          value: undefined,
+                          termType: undefined,
+                          type: 'and',
+                          key: randomString(),
+                        },
+                      ],
+                    });
+                    const _data = cacheValueRef.current;
+                    set(_data, 'terms', newThenTerms);
+                    props.onUpdate(_data, optionsRef.current);
+                  }}
+                  onValueChange={(termsData) => {
+                    const _data = cacheValueRef.current;
+                    set(_data, ['terms', index], termsData);
+                    // cacheValueRef.current = _data;
+                    props.onUpdate(_data, {
+                      ...optionsRef.current,
+                    });
+                  }}
+                  onLabelChange={(lb) => {
+                    const newLabel: any[] = props.options?.terms || [];
+                    newLabel.splice(index, 1, lb);
+                    optionsRef.current['terms'] = newLabel;
+                    props.onUpdate(cacheValueRef.current, optionsRef.current);
+                  }}
+                  onDelete={() => {
+                    const _data = thenTerms.filter((a) => a.key !== termsItem.key);
+                    if (optionsRef.current?.termsColumns) {
+                      optionsRef.current.termsColumns[index] = [];
+                      const filterColumns = new Set(flattenDeep(optionsRef.current.termsColumns)); // 平铺去重
+                      let newColumns = [...filterColumns.values()];
+                      if (optionsRef.current?.otherColumns) {
+                        newColumns = [...optionsRef.current.otherColumns, ...newColumns];
+                      }
+                      optionsRef.current['columns'] = newColumns;
+                    }
+                    props.onUpdate(
+                      {
+                        ...cacheValueRef.current,
+                        terms: _data,
+                      },
+                      optionsRef.current,
+                    );
+                  }}
+                />
+              ))
+            ) : (
+              <div
+                className="filter-add-button"
+                onClick={() => {
+                  getParams();
+                  let _data = cacheValueRef.current;
+                  optionsRef.current['terms'] = [];
+                  if (!_data.terms) {
+                    _data = {
+                      ..._data,
+                      terms: [
+                        {
+                          type: 'and',
+                          key: randomString(),
+                          terms: [
+                            {
+                              column: undefined,
+                              value: undefined,
+                              termType: undefined,
+                              type: 'and',
+                              key: randomString(),
+                            },
+                          ],
+                        },
+                      ],
+                    };
+                    props.onUpdate(_data, optionsRef.current);
+                  } else {
+                    _data.terms = [
                       {
                         type: 'and',
                         key: randomString(),
@@ -489,34 +511,17 @@ export default (props: ItemProps) => {
                           },
                         ],
                       },
-                    ],
-                  };
-                  props.onUpdate(_data, optionsRef.current);
-                } else {
-                  _data.terms = [
-                    {
-                      type: 'and',
-                      key: randomString(),
-                      terms: [
-                        {
-                          column: undefined,
-                          value: undefined,
-                          termType: undefined,
-                          type: 'and',
-                          key: randomString(),
-                        },
-                      ],
-                    },
-                  ];
-                  props.onUpdate(_data, optionsRef.current);
-                }
-              }}
-            >
-              <PlusOutlined style={{ paddingRight: 4 }} /> 添加过滤条件
-            </div>
-          )}
+                    ];
+                    props.onUpdate(_data, optionsRef.current);
+                  }
+                }}
+              >
+                <PlusOutlined style={{ paddingRight: 4 }} /> 添加过滤条件
+              </div>
+            )}
+          </div>
         </div>
-      </div>
+      )}
       {visible && (
         <Modal
           name={props.name}

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

@@ -39,6 +39,7 @@ export default (props: ListProps) => {
               data={item}
               type={props.type}
               key={item.key}
+              isLast={index === actions.length - 1}
               parallel={props.parallel}
               options={item.options}
               onDelete={() => {

+ 8 - 0
src/pages/rule-engine/Scene/Save/action/ListItem/index.less

@@ -261,6 +261,14 @@
         display: flex;
         align-items: center;
       }
+
+      .ant-form-item {
+        &:not(:first-child) {
+          .ant-form-item-explain-error {
+            padding-left: 80px !important;
+          }
+        }
+      }
     }
 
     .term-type-warp {

+ 7 - 7
src/pages/rule-engine/Scene/Save/action/index.tsx

@@ -90,18 +90,18 @@ export default (props: ActionsProps) => {
                 parallel={false}
                 actions={serialArray.length ? serialArray[0].actions : []}
                 onAdd={(actionItem) => {
-                  console.log('addModel', serialArray);
-                  if (serialArray.length) {
-                    const indexOf = serialArray[0].actions?.findIndex(
+                  const newSerialArray = [...serialArray];
+                  if (newSerialArray.length) {
+                    const indexOf = newSerialArray[0].actions?.findIndex(
                       (aItem) => aItem.key === actionItem.key,
                     );
                     if (indexOf !== -1) {
-                      serialArray[0].actions.splice(indexOf, 1, actionItem);
+                      newSerialArray[0].actions.splice(indexOf, 1, actionItem);
                     } else {
-                      serialArray[0].actions.push(actionItem);
+                      newSerialArray[0].actions.push(actionItem);
                     }
-                    setSerialArray([...serialArray]);
-                    props.onUpdate(serialArray[0], false);
+                    setSerialArray([...newSerialArray]);
+                    props.onUpdate(newSerialArray[0], false);
                   } else {
                     actionItem.key = randomString();
                     props.onAdd({

+ 1 - 1
src/pages/rule-engine/Scene/Save/components/Buttons/useOption.tsx

@@ -7,7 +7,7 @@ interface OptionsProps {
 
 const useOptions = (options: any[], key?: any): OptionsProps => {
   return useMemo(() => {
-    const _options = options;
+    const _options = options || [];
     const valueOptions = new Map<string, any>();
 
     function dig(optionsList: any[]) {

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

@@ -47,7 +47,7 @@ export default observer((props: Props) => {
     if (!options || !Object.keys(options).length) return '点击配置设备触发';
 
     const _label = [
-      <div style={{ display: 'flex' }}>
+      <div style={{ display: 'flex', alignItems: 'center' }}>
         {options.selectorIcon ? <AIcon type={options.selectorIcon} /> : null}
         <span className="trigger-options-name">{options.name}</span>
         {options.extraName ? <span>{options.extraName}</span> : null}

+ 5 - 3
src/pages/rule-engine/Scene/Save/index.tsx

@@ -138,15 +138,17 @@ export default observer(() => {
             ...resp.result,
           };
           const newBranches = cloneDeep(assignmentKey(branches));
-          FormModel.current.options = { ...defaultOptions, ...resp.result.options };
-          FormModel.current.trigger = resp.result.trigger || {};
-          FormModel.current.branches = newBranches;
+
           form.setFieldValue('description', resp.result.description);
 
           if (['device', 'timer'].includes(_triggerType)) {
             form.setFieldValue(_triggerType, resp.result.trigger[_triggerType]);
           }
           form.setFieldValue('branches', newBranches);
+
+          FormModel.current.options = { ...defaultOptions, ...resp.result.options };
+          FormModel.current.trigger = resp.result.trigger || {};
+          FormModel.current.branches = newBranches;
         }
       });
     }

+ 16 - 1
src/pages/rule-engine/Scene/Save/terms/index.less

@@ -37,11 +37,18 @@
 }
 
 .actions-terms {
-  width: 66.66%;
   .actions-terms-warp {
     display: flex;
+    width: 66.66%;
     margin-bottom: 24px;
 
+    &.first-children {
+      width: 100%;
+      .actions-branches {
+        width: 66.66%;
+      }
+    }
+
     &.first-children,
     &:last-child {
       margin-bottom: 0;
@@ -126,6 +133,14 @@
       display: flex;
       align-items: center;
     }
+
+    .ant-form-item {
+      &:not(:first-child) {
+        .ant-form-item-explain-error {
+          padding-left: 80px !important;
+        }
+      }
+    }
   }
 
   .terms-group-add {

+ 20 - 20
src/pages/rule-engine/Scene/Save/terms/paramsItem.tsx

@@ -18,6 +18,7 @@ interface ParamsItemProps {
   pName: (number | string)[];
   name: number;
   isLast: boolean;
+  isFirst: boolean;
   isDelete: boolean;
   options: any[];
   onValueChange?: (value: TermsType) => void;
@@ -144,7 +145,6 @@ const ParamsItem = observer((props: ParamsItemProps) => {
     (columnValue?: string) => {
       if (columnValue && paramOptions.length) {
         const labelOptions = paramsValueOptions.get(columnValue);
-        console.log('paramsValueOptions ===>>', columnValue, labelOptions);
         if (labelOptions) {
           const _termTypeOptions: any[] =
             labelOptions?.termTypes?.map((tItem: any) => ({ title: tItem.name, key: tItem.id })) ||
@@ -192,6 +192,24 @@ const ParamsItem = observer((props: ParamsItemProps) => {
 
   return (
     <div className="terms-params-item">
+      {!props.isFirst && (
+        <div className="term-type-warp">
+          <DropdownButton
+            options={[
+              { title: '并且', key: 'and' },
+              { title: '或者', key: 'or' },
+            ]}
+            isTree={false}
+            type="type"
+            value={props.data.type}
+            onChange={(v) => {
+              props.data.type = v;
+              labelCache.current[3] = v;
+              props.onLabelChange?.([...labelCache.current]);
+            }}
+          />
+        </div>
+      )}
       <div
         className="params-item_button"
         onMouseOver={() => {
@@ -332,7 +350,6 @@ const ParamsItem = observer((props: ParamsItemProps) => {
               });
               ValueRef.current.value = v;
               labelCache.current[2] = { 0: lb };
-              console.log('valueChange', labelCache.current);
               labelCache.current[3] = props.data.type;
               props.onLabelChange?.([...labelCache.current]);
               valueEventChange(v);
@@ -346,24 +363,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
           </div>
         </Popconfirm>
       </div>
-      {!props.isLast ? (
-        <div className="term-type-warp">
-          <DropdownButton
-            options={[
-              { title: '并且', key: 'and' },
-              { title: '或者', key: 'or' },
-            ]}
-            isTree={false}
-            type="type"
-            value={props.data.type}
-            onChange={(v) => {
-              props.data.type = v;
-              labelCache.current[3] = v;
-              props.onLabelChange?.([...labelCache.current]);
-            }}
-          />
-        </div>
-      ) : (
+      {props.isLast && (
         <div className="term-add" onClick={props.onAdd}>
           <div className="terms-content">
             <PlusOutlined style={{ fontSize: 12 }} />

+ 10 - 1
src/pages/rule-engine/Scene/Save/terms/term.tsx

@@ -67,7 +67,15 @@ export default observer((props: TermsProps) => {
               const terms: TermsType[] = _when?.terms || [];
               return terms.map((item, index) => (
                 <Form.Item
-                  name={['branches', ...props.pName, props.whenName, 'terms', props.name]}
+                  name={[
+                    'branches',
+                    ...props.pName,
+                    props.whenName,
+                    'terms',
+                    props.name,
+                    'terms',
+                    index,
+                  ]}
                   rules={[
                     {
                       validator(_, v) {
@@ -107,6 +115,7 @@ export default observer((props: TermsProps) => {
                     data={item}
                     key={item.key}
                     isLast={index === props.data.terms!.length - 1}
+                    isFirst={index === 0}
                     options={props.paramsOptions}
                     label={
                       FormModel.current.options?.when?.[props.whenName]?.terms?.[props.name]

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

@@ -5,7 +5,6 @@ import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
 import { Badge, Popconfirm } from 'antd';
 import {
-  DatabaseOutlined,
   DeleteOutlined,
   EditOutlined,
   PlayCircleOutlined,
@@ -15,7 +14,7 @@ import {
 import { useIntl } from '@@/plugin-locale/localeExports';
 import { useEffect, useRef, useState } from 'react';
 import { observer } from '@formily/react';
-import { PermissionButton } from '@/components';
+import { AIcon, PermissionButton } from '@/components';
 import usePermissions from '@/hooks/permission';
 import Save from './Save';
 import { Store } from 'jetlinks-store';
@@ -153,7 +152,7 @@ const DataSource = observer(() => {
                 : '管理',
           }}
         >
-          <DatabaseOutlined />
+          <AIcon type={'icon-ziyuankuguanli'} />
         </PermissionButton>,
         <PermissionButton
           style={{ padding: 0 }}

+ 36 - 1
src/pages/system/Department/Assets/product/bind.tsx

@@ -1,7 +1,7 @@
 // 资产-产品分类-绑定
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import { service } from './index';
-import { message, Modal } from 'antd';
+import { Badge, message, Modal, Space } from 'antd';
 import Models from './model';
 import { useEffect, useRef, useState } from 'react';
 import { observer } from '@formily/react';
@@ -20,6 +20,11 @@ interface Props {
   parentId: string;
 }
 
+const status = {
+  1: <Badge status="success" text={'正常'} />,
+  0: <Badge status="error" text={'禁用'} />,
+};
+
 const Bind = observer((props: Props) => {
   const intl = useIntl();
   const actionRef = useRef<ActionType>();
@@ -51,6 +56,36 @@ const Bind = observer((props: Props) => {
       }),
       hideInSearch: true,
     },
+    {
+      title: '状态',
+      dataIndex: 'state',
+      render: (_, row) => <Space size={0}>{status[row.state]}</Space>,
+      valueType: 'select',
+      width: '90px',
+      valueEnum: {
+        // 2: {
+        //   text: intl.formatMessage({
+        //     id: 'pages.searchTable.titleStatus.all',
+        //     defaultMessage: '全部',
+        //   }),
+        //   status: 2,
+        // },
+        0: {
+          text: intl.formatMessage({
+            id: 'pages.device.product.status.disabled',
+            defaultMessage: '禁用',
+          }),
+          status: 0,
+        },
+        1: {
+          text: intl.formatMessage({
+            id: 'pages.device.product.status.enabled',
+            defaultMessage: '正常',
+          }),
+          status: 1,
+        },
+      },
+    },
   ];
 
   const handleBind = () => {

+ 36 - 1
src/pages/system/Department/Assets/product/index.tsx

@@ -1,7 +1,7 @@
 // 资产分配-产品分类
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import { useIntl } from '@@/plugin-locale/localeExports';
-import { Modal } from 'antd';
+import { Badge, Modal, Space } from 'antd';
 import { useEffect, useRef, useState } from 'react';
 import { observer } from '@formily/react';
 import type { ProductItem } from '@/pages/system/Department/typings';
@@ -21,6 +21,11 @@ import UpdateModal from '../updateModal';
 
 export const service = new Service<ProductItem>('assets');
 
+const status = {
+  1: <Badge status="success" text={'正常'} />,
+  0: <Badge status="error" text={'禁用'} />,
+};
+
 export default observer((props: { parentId: string }) => {
   const intl = useIntl();
   const actionRef = useRef<ActionType>();
@@ -109,6 +114,36 @@ export default observer((props: { parentId: string }) => {
       width: 200,
     },
     {
+      title: '状态',
+      dataIndex: 'state',
+      render: (_, row) => <Space size={0}>{status[row.state]}</Space>,
+      valueType: 'select',
+      width: '90px',
+      valueEnum: {
+        // 2: {
+        //   text: intl.formatMessage({
+        //     id: 'pages.searchTable.titleStatus.all',
+        //     defaultMessage: '全部',
+        //   }),
+        //   status: 2,
+        // },
+        0: {
+          text: intl.formatMessage({
+            id: 'pages.device.product.status.disabled',
+            defaultMessage: '禁用',
+          }),
+          status: 0,
+        },
+        1: {
+          text: intl.formatMessage({
+            id: 'pages.device.product.status.enabled',
+            defaultMessage: '正常',
+          }),
+          status: 1,
+        },
+      },
+    },
+    {
       title: intl.formatMessage({
         id: 'pages.data.option',
         defaultMessage: '操作',

+ 1 - 0
src/pages/system/Department/typings.d.ts

@@ -28,6 +28,7 @@ export type ProductItem = {
   name: string;
   description: string;
   grantedPermissions?: string[];
+  state: number;
 };
 
 // 产品分类