|  | @@ -1,11 +1,25 @@
 | 
	
		
			
				|  |  |  import DDComponents from '@/components/DDComponents';
 | 
	
		
			
				|  |  |  import React, { useMemo, useState } from 'react';
 | 
	
		
			
				|  |  |  import { Button, Form } from 'antd';
 | 
	
		
			
				|  |  | -import tableField from '../../../components/DDComponents/TableField';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  const AuditDetailed = (props) => {
 | 
	
		
			
				|  |  |    // const [form] = Form.useForm();
 | 
	
		
			
				|  |  | -  const { items, form, onValuesChange, onTableValChange } = props;
 | 
	
		
			
				|  |  | +  const {
 | 
	
		
			
				|  |  | +    allValues = [],
 | 
	
		
			
				|  |  | +    items,
 | 
	
		
			
				|  |  | +    form,
 | 
	
		
			
				|  |  | +    onValuesChange,
 | 
	
		
			
				|  |  | +    onTableValChange,
 | 
	
		
			
				|  |  | +  } = props;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  const depId = useMemo(() => {
 | 
	
		
			
				|  |  | +    const id = items.find((item) => item.componentName == 'DepartmentField')
 | 
	
		
			
				|  |  | +      ?.props.id;
 | 
	
		
			
				|  |  | +    const value = allValues.find((item) => item.id == id)?.value;
 | 
	
		
			
				|  |  | +    if (value) return value[0];
 | 
	
		
			
				|  |  | +  }, [allValues, items]);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  console.log(items, allValues);
 | 
	
		
			
				|  |  |    const data = useMemo(() => {
 | 
	
		
			
				|  |  |      let linkedData = {};
 | 
	
		
			
				|  |  |      items.forEach((d) => {
 | 
	
	
		
			
				|  | @@ -58,14 +72,6 @@ const AuditDetailed = (props) => {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    // const handleColumnChange = (value, id) => {
 | 
	
		
			
				|  |  | -    //   console.log(value, id);
 | 
	
		
			
				|  |  | -    //   let ids = id.split(';');
 | 
	
		
			
				|  |  | -    //   let position = ids[0].split(',').map((item) => Number(item));
 | 
	
		
			
				|  |  | -    //   let columnID = ids[1];
 | 
	
		
			
				|  |  | -    //   onColumnValChange(position, columnID);
 | 
	
		
			
				|  |  | -    // };
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      // const component = DDComponents({ item });
 | 
	
		
			
				|  |  |      // if (!component) return null;
 | 
	
		
			
				|  |  |      return (
 | 
	
	
		
			
				|  | @@ -77,7 +83,11 @@ const AuditDetailed = (props) => {
 | 
	
		
			
				|  |  |              label={formLabel}
 | 
	
		
			
				|  |  |              rules={[{ required: required }]}
 | 
	
		
			
				|  |  |            >
 | 
	
		
			
				|  |  | -            <DDComponents item={item} />
 | 
	
		
			
				|  |  | +            {item.componentName === 'CodeField' ? (
 | 
	
		
			
				|  |  | +              <DDComponents item={item} depId={depId} />
 | 
	
		
			
				|  |  | +            ) : (
 | 
	
		
			
				|  |  | +              <DDComponents item={item} />
 | 
	
		
			
				|  |  | +            )}
 | 
	
		
			
				|  |  |            </Form.Item>
 | 
	
		
			
				|  |  |          ) : (
 | 
	
		
			
				|  |  |            <DDComponents item={item} onChange={onTableValChange} />
 |