Commit 377df153af07283d813571079d3efb3cf90743e2

Authored by 邱嘉伟
1 parent df883022

fix:修复操作框 无法点击问题

... ... @@ -690,6 +690,7 @@ export const QxBaseConditionItem: React.FC<QxBaseConditionItemProps> = ({
690 690 subset,
691 691 params,
692 692 fieldGroupType,
  693 + disabled,
693 694 showAssignment = true,
694 695 isMixValue,
695 696 fieldType,
... ... @@ -780,7 +781,7 @@ export const QxBaseConditionItem: React.FC<QxBaseConditionItemProps> = ({
780 781 onChange={handleChange}
781 782 isMultiple={multipleType.includes(fieldGroupType)}
782 783 isRange={optValTypeCheck.isRangeType(value?.opt)}
783   - disabled={optValTypeCheck.isEmptyType(value?.opt)}
  784 + disabled={optValTypeCheck.isEmptyType(value?.opt) || disabled}
784 785 getName={getName}
785 786 widget={field?.extract?.widget}
786 787 isMixValue={isMixValue}
... ...
... ... @@ -97,6 +97,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
97 97 type,
98 98 } = props;
99 99 const [searchValue, setSearchValue] = useState('');
  100 + const [mExpandedKeys, setMExpandedKeys] = useState(expandedKeys);
  101 + const [isExpand, setIsExpand] = useState(true);
100 102
101 103 // const [form] = Form.useForm()
102 104 //判断数组是否只有一个子节点
... ... @@ -130,6 +132,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
130 132 }
131 133 return true;
132 134 };
  135 +
  136 + const handleTree = (id: any) => {
  137 + setIsExpand(true);
  138 + handleAddTree(id);
  139 + };
  140 +
133 141 const typeDis = !!type;
134 142 const columns = [
135 143 {
... ... @@ -249,7 +257,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
249 257 value={[
250 258 {
251 259 mappingValues: text?.mappingValues || [],
252   - // disabled: disabled,
  260 + disabled: record.disabled,
253 261 valuesObj: record.valuesObj || [],
254 262 params: { appCode: 'appCode', useId: true },
255 263 // valueOptions: getValueOptions(nodeData),
... ... @@ -363,7 +371,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
363 371 component={SubNodeIcon}
364 372 />
365 373 }
366   - onClick={() => handleAddTree(record.id)}
  374 + onClick={() => handleTree(record.id)}
367 375 />
368 376 )}
369 377
... ... @@ -380,7 +388,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
380 388 type={'qx-icon-delete'}
381 389 />
382 390 }
383   - onClick={() => handleDelete(record)}
  391 + onClick={(e) => handleDelete(e, record)}
384 392 />
385 393 )}
386 394 </Space>
... ... @@ -614,6 +622,15 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
614 622 }, [visible]);
615 623
616 624 useEffect(() => {
  625 + setMExpandedKeys(expandedKeys);
  626 + // if (visible) {
  627 + // if (data.length == 0) {
  628 + // handleAdd('');
  629 + // }
  630 + // }
  631 + }, [expandedKeys]);
  632 +
  633 + useEffect(() => {
617 634 const value = cloneDeep(data);
618 635 const expandedArray: any = [];
619 636 (value || []).map((_item: ParamDesignModel) => {
... ... @@ -779,6 +796,24 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
779 796 setMidData(_data);
780 797 };
781 798
  799 + const onModalExpand = (data, e, onExpand) => {
  800 + setIsExpand(false);
  801 + // console.log('data', data)
  802 + // console.log('mExpandedKeys', mExpandedKeys)
  803 + const index = mExpandedKeys.indexOf(data.id);
  804 + if (index > -1) {
  805 + mExpandedKeys.splice(index, 1);
  806 + setMExpandedKeys(mExpandedKeys);
  807 + } else {
  808 + mExpandedKeys.push(data.id);
  809 + setMExpandedKeys(mExpandedKeys);
  810 + }
  811 +
  812 + setTimeout(() => {
  813 + onExpand(data, e);
  814 + }, 400);
  815 + };
  816 +
782 817 const RenderTitle = (
783 818 <div>
784 819 高级参数设计器
... ... @@ -798,7 +833,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
798 833 </Tooltip>
799 834 </div>
800 835 );
801   -
802 836 return (
803 837 <>
804 838 <Modal
... ... @@ -898,7 +932,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
898 932 expandable={{
899 933 defaultExpandAllRows: true,
900 934 childrenColumnName: 'child',
901   - expandedRowKeys: expandedKeys,
  935 + expandedRowKeys: isExpand ? mExpandedKeys : false,
902 936 expandIcon: ({ expanded, onExpand, record }) =>
903 937 record.child && record.child.length > 0 && expanded ? (
904 938 <>
... ... @@ -906,7 +940,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
906 940 <QxBaseIcon
907 941 className={'table-expanded'}
908 942 type={'qx-caret-down'}
909   - onClick={(e) => onExpand(record, e)}
  943 + onClick={(e) => onModalExpand(record, e, onExpand)}
910 944 />
911 945 </>
912 946 ) : record.child && record.child.length > 0 && !expanded ? (
... ... @@ -915,7 +949,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
915 949 <QxBaseIcon
916 950 className={'table-expanded-change'}
917 951 type={'qx-caret-down'}
918   - onClick={(e) => onExpand(record, e)}
  952 + onClick={(e) => onModalExpand(record, e, onExpand)}
919 953 />
920 954 </>
921 955 ) : record.disabled ? (
... ...
... ... @@ -410,6 +410,10 @@
410 410 .ps-table-cell {
411 411 transition: all 0s ease !important;
412 412
  413 + .ant-select-selection-overflow {
  414 + flex-wrap: nowrap;
  415 + }
  416 +
413 417 &:hover {
414 418 border: 1px solid @N6 !important;
415 419 box-shadow: 0 0 4px 0 @N6 !important;
... ...